Part Number Hot Search : 
STA3350 T421004 0N08S 5KP20 LC46A 29312 B0505 BF494
Product Description
Full Text Search
 

To Download ST10F269-DP Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  1/160 st10f269 june 2002 n high performance 40mhz cpu with dsp function C 16-bit cpu with 4-stage pipeline C 50ns instruction cycle time at 40mhz max cpu clock C multiply/accumulate unit (mac) 16 x 16-bit multiplication, 40-bit accumulator C repeat unit C enhanced boolean bit manipulation fa- cilities C additional instructions to support hll and operating systems C single-cycle context switching sup- port n memory organization C 256k byte on-chip flash memory single voltage with erase/program controller. C 100k erasing/programming cycles. C up to 16m byte linear address space for code and data (5m bytes with can) C 2k byte on-chip internal ram (iram) C 10k byte on-chip extension ram (xram) n fast and flexible bus C programmable external bus characte- ristics for different address ranges C 8-bit or 16-bit external data bus C multiplexed or demultiplexed external address/data buses C five programmable chip-select signals C hold-acknowledge bus arbitration sup- port n interrupt C 8-channel peripheral event controller for single cycle interrupt driven data transfer C 16-priority-level interrupt system with 56 sources, sampling rate down to 25ns n timers C two multi-functional general purpose timer units with 5 timers n two 16-channel capture / compare units n a/d converter C 16-channel 10-bit C 4.85 m s conversion time at 40mhz cpu clock n 4-channel pwm unit n serial channels C synchronous / asynchronous serial channel C high-speed synchronous channel n two can 2.0b interfaces operating on one or two can busses (30 or 2x15 message objects) n fail-safe protection C programmable watchdog timer C oscillator watchdog n on-chip bootstrap loader n clock generation C on-chip pll C direct or prescaled clock input n real time clock n up to 111 general purpose i/o lines C individually programmable as input, output or special function C programmable threshold (hysteresis) n idle and power down modes n single voltage supply: 5v 10% (embedded regulator for 3.3 v core supply). n temperature range: -40 +125 c n 144-pin pqfp package pqfp144 (28 x 28 mm) (plastic quad flat pack) order code: st10f269-q3 can2_txd can1_txd can1_rxd can2_rxd por t 0 por t 1 por t 4 port 6 por t 5 port 3 por t 2 gpt1 asc usart brg cpu-core and mac unit internal ram watchdog interrupt controller 8 32 16 pec 16 16 can1 port 7 port 8 external bus 10-bit adc brg ssc pwm capcom2 capcom1 16 oscillator controller 16 16 256k byte and pll flash memory xtal1 xtal2 2k byte 16 15 8 8 8 16 3.3v voltage regulator 10k byte xram can2 gpt2 16-bit mcu with mac unit, 256k byte flash memory and 12k byte ram preliminary data this is advance information on a new product now in development or undergoing evaluation. details are subject to change without notice.
st10f269 2/160 table of contents page 1 - introduction ........................................................................................................ 6 2 - pin data ................................................................................................................... 7 3 - functional description ................................................................................... 13 4 - memory organization ....................................................................................... 14 5 - internal flash memory ................................................................................... 17 5.1 - overview ................................................................................................................ 1 7 5.2 - operational overview ...................................................................................... 17 5.3 - architectural description ............................................................................ 19 5.3.1 - read mode .............................................................................................................. ... 19 5.3.2 - command mode ......................................................................................................... 19 5.3.3 - ready/busy signal ..................................................................................................... 1 9 5.3.4 - flash status register ................................................................................................. 1 9 5.3.5 - flash protection register ........................................................................................... 21 5.3.6 - instructions description .............................................................................................. 2 1 5.3.7 - reset processing and initial state .............................................................................. 25 5.4 - flash memory configuration ........................................................................ 25 5.5 - application examples ....................................................................................... 25 5.5.1 - handling of flash addresses ...................................................................................... 25 5.5.2 - basic flash access control ........................................................................................ 26 5.5.3 - programming examples ............................................................................................. 27 5.6 - bootstrap loader ............................................................................................ 30 5.6.1 - entering the bootstrap loader .................................................................................... 30 5.6.2 - memory configuration after reset ............................................................................. 31 5.6.3 - loading the startup code ........................................................................................... 32 5.6.4 - exiting bootstrap loader mode .................................................................................. 32 5.6.5 - choosing the baud rate for the bsl ......................................................................... 33 6 - central processing unit (cpu) ..................................................................... 34 6.1 - multiplier-accumulator unit (mac) ............................................................. 35 6.1.1 - features ............................................................................................................... ...... 36 6.1.1.1 - enhanced addressing capabilities .............................................................................. 36 6.1.1.2 - multiply-accumulate unit ............................................................................................. 36 6.1.1.3 - program control ....................................................................................................... ... 36 6.2 - instruction set summary ................................................................................ 37 6.3 - mac coprocessor specific instructions ................................................. 38 7 - external bus controller .............................................................................. 42 7.1 - programmable chip select timing control ............................................ 42 7.2 - ready programmable polarity ..................................................................... 42
st10f269 3/160 table of contents page 8 - interrupt system ............................................................................................... 44 8.1 - external interrupts ......................................................................................... 44 8.2 - interrupt registers and vectors location list .................................. 45 8.3 - interrupt control registers ....................................................................... 46 8.4 - exception and error traps list ................................................................... 47 9 - capture/compare (capcom) units ................................................................ 48 10 - general purpose timer unit .......................................................................... 51 10.1 - gpt1 .................................................................................................................... ...... 51 10.2 - gpt2 .................................................................................................................... ...... 52 11 - pwm module .......................................................................................................... 54 12 - parallel ports ................................................................................................... 55 12.1 - introduction ........................................................................................................ 55 12.2 - i/os special features ....................................................................................... 57 12.2.1 - open drain mode ....................................................................................................... 57 12.2.2 - input threshold control ............................................................................................ 5 7 12.2.3 - output driver control ............................................................................................... .58 12.2.4 - alternate port functions ............................................................................................. 6 0 12.3 - port0 ................................................................................................................... ..... 61 12.3.1 - alternate functions of port0 .................................................................................... 62 12.4 - port1 ................................................................................................................... ..... 64 12.4.1 - alternate functions of port1 .................................................................................... 64 12.5 - port 2 .................................................................................................................. ..... 66 12.5.1 - alternate functions of port 2 ...................................................................................... 66 12.6 - port 3 .................................................................................................................. ..... 69 12.6.1 - alternate functions of port 3 ...................................................................................... 70 12.7 - port 4 .................................................................................................................. ..... 73 12.7.1 - alternate functions of port 4 ...................................................................................... 74 12.8 - port 5 .................................................................................................................. ..... 77 12.8.1 - alternate functions of port 5 ...................................................................................... 78 12.8.2 - port 5 schmitt trigger analog inputs .......................................................................... 79 12.9 - port 6 .................................................................................................................. ..... 79 12.9.1 - alternate functions of port 6 ...................................................................................... 80 12.10 - port 7 ................................................................................................................. ...... 83 12.10.1 - alternate functions of port 7 ...................................................................................... 84 12.11 - port 8 ................................................................................................................. ...... 87 12.11.1 - alternate functions of port 8 ...................................................................................... 88
st10f269 4/160 table of contents page 13 - a/d converter ...................................................................................................... 90 14 - serial channels ................................................................................................. 91 14.1 - asynchronous / synchronous serial interface (asco) .................... 91 14.1.1 - asco in asynchronous mode .................................................................................... 91 14.1.2 - asco in synchronous mode ...................................................................................... 93 14.2 - high speed synchronous serial channel (ssc) ..................................... 95 15 - can modules ......................................................................................................... 97 15.1 - can modules memory mapping ...................................................................... 97 15.1.1 - can1 .................................................................................................................. ........ 97 15.1.2 - can2 .................................................................................................................. ........ 97 15.2 - can bus configurations .................................................................................. 97 16 - real time clock .................................................................................................. 99 16.1 - rtc registers ...................................................................................................... 100 16.1.1 - rtccon: rtc control register ................................................................................ 100 16.1.2 - rtcph & rtcpl: rtc prescaler registers ....................................................... 101 16.1.3 - rtcdh & rtcdl: rtc divider counters .............................................................. 101 16.1.4 - rtch & rtcl: rtc programmable counter registers ....................................... 102 16.1.5 - rtcah & rtcal: rtc alarm registers ................................................................ 103 16.2 - programming the rtc ....................................................................................... 103 17 - watchdog timer .................................................................................................. 105 18 - system reset ........................................................................................................ 107 18.1 - long hardware reset ...................................................................................... 107 18.1.1 - asynchronous reset .................................................................................................. 10 7 18.1.2 - synchronous reset (rstin pulse > 1040tcl and rpd pin at high level) ................ 108 18.1.3 - exit of long hardware reset ...................................................................................... 109 18.2 - short hardware reset .................................................................................... 109 18.3 - software reset .................................................................................................. 110 18.4 - watchdog timer reset ..................................................................................... 110 18.5 - rstout, rstin, bidirectional reset ............................................................ 111 18.5.1 - rstout pin ............................................................................................................ ... 111 18.5.2 - bidirectional reset ................................................................................................... ... 111 18.5.3 - rstin pin ............................................................................................................. ...... 111 18.6 - reset circuitry ................................................................................................... 111 19 - power reduction modes ................................................................................. 114 19.1 - idle mode ............................................................................................................... .114 19.2 - power down mode .............................................................................................. 114 19.2.1 - protected power down mode ..................................................................................... 114 19.2.2 - interruptable power down mode ................................................................................ 114
st10f269 5/160 table of contents page 20 - special function register overview ......................................................... 117 20.1 - identification registers ................................................................................. 123 20.2 - system configuration registers ................................................................ 124 21 - electrical characteristics ......................................................................... 131 21.1 - absolute maximum ratings ............................................................................. 131 21.2 - parameter interpretation ............................................................................. 131 21.3 - dc characteristics ........................................................................................... 131 21.3.1 - a/d converter characteristics .................................................................................... 134 21.3.2 - conversion timing control ....................................................................................... 135 21.4 - ac characteristics ............................................................................................ 136 21.4.1 - test waveforms ...................................................................................................... .136 21.4.2 - definition of internal timing ........................................................................................ 1 36 21.4.3 - clock generation modes ............................................................................................ 137 21.4.4 - prescaler operation ................................................................................................... .138 21.4.5 - direct drive .......................................................................................................... ....... 138 21.4.6 - oscillator watchdog (owd) ....................................................................................... 138 21.4.7 - phase locked loop .................................................................................................... 1 38 21.4.8 - external clock drive xtal1 ....................................................................................... 139 21.4.9 - memory cycle variables ............................................................................................. 140 21.4.10 - multiplexed bus ...................................................................................................... .... 141 21.4.11 - demultiplexed bus .................................................................................................... .. 147 21.4.12 - clkout and ready ................................................................................................. 153 21.4.13 - external bus arbitration ............................................................................................. .155 21.4.14 - high-speed synchronous serial interface (ssc) timing ........................................... 157 21.4.14.1 master mode........................................................................................................... ..... 157 21.4.14.2 slave mode............................................................................................................ ...... 158 22 - package mechanical data ........................................................................... 159 23 - ordering information ...................................................................................... 159
st10f269 6/160 1 - introduction the st10f269 is a derivative of the stmicroelectronics st10 family of 16-bit single-chip cmos microcontrollers. it combines high cpu performance (up to 20 million instructions per second) with high peripheral functionality and enhanced i/o-capabilities. it also provides on-chip high-speed single voltage flash memory, on-chip high-speed ram, and clock generation via pll. st10f269 is processed in 0.35 m m cmos technology. the mcu core and the logic is supplied with a 5v to 3.3v on chip voltage regulator. the part is supplied with a single 5v supply and i/os work at 5v. the device is upward compatible with the st10f168 device, with the following set of differences: C the multiply/accumulate unit is available as standard. this mac unit adds powerful dsp functions to the st10 architecture, but maintains full compatibility for existing code. C flash control interface is now based on stmicroelectronics third generation of stand-alone flash memories, with an embedded erase/program controller. this completely frees up the cpu during programming or erasing the flash. C two dedicated pins (dc1 and dc2) on the pqfp-144 package are used for decoupling the internally generated 3.3v core logic supply. do not connect these two pins to 5.0v external supply. instead, these pins should be connected to a decoupling capacitor (ceramic type, value 3 330 nf). C the a/d converter characteristics are different from previous st10 derivatives ones. refer to section 21.3.1 - a/d converter characteristics. C the ac and dc parameters are adapted to the 40mhz maximum cpu frequency. the characterization is performed with c l = 50pf max on output pins. refer to section 21.3 dc characteristics. C in order to reduce emc, the rise/fall time and the sink/source capability of the drivers of the i/o pads are programmable. refer to section 12.2 i/ os special features. C the real time clock functionnality is added. C the external interrupt sources can be selected with the exisel register. C the reset source is identified by a dedicated status bit in the wdtcon register. figure 1 : logic symbol xtal1 rstin xtal2 rstout nmi ea ready ale rd wr /wrl port 5 16-bit port 6 8-bit port 4 8-bit port 3 15-bit port 2 16-bit port 1 16-bit port 0 16-bit v dd v ss port 7 8-bit port 8 8-bit v aref v agnd rpd dc1 dc2 st10f269
st10f269 7/160 2 - pin data figure 2 : pin configuration (top view) p6.0/cs0 p6.1/cs1 p6.2/cs2 p6.3/cs3 p6.4/cs4 p6.5/hold p6.6/hlda p6.7/breq p8.0/cc16io p8.1/cc17io p8.2/cc18io p8.3/cc19io p8.4/cc20io p8.6/cc22io p8.7/cc23io dc2 v ss p7.0/pout0 p7.1/pout1 p7.2/pout2 p7.3/pout3 p8.5/cc21io rpd p7.4/cc28i0 p7.5/cc29i0 p7.6/cc30i0 p7.7/cc31i0 p5.0/an0 p5.1/an1 p5.2/an2 p5.3/an3 p5.4/an4 p5.5/an5 p5.6/an6 p5.7/an7 p5.8/an8 p5.9/an9 p0h.0/ad8 p0l.7/ad7 p0l.6/ad6 p0l.5/ad5 p0l.4/ad4 p0l.3/ad3 p0l.2ad2 p0l.a/ad1 p0l.0/ad0 ea ale ready wr/wrl rd v ss v dd p4.7a23/can2_txd p4.6a22/can1_txd p4.5a21/can1_rxd p4.4a20/can2_rxd p4.3/a19 p4.2/a18 p4.1/a17 p4.0/a16 v ss v dd p3.15/clkout p3.13/sclk p3.12/bhe /wrh p3.11/rxd0 p3.10/txd0 p3.9/mtsr p3.8/mrst p3.7/t2in p3.6/t3in v aref v agnd p5.10/an10/t6eud p5.11/an11/t5eud p5.12/an12/t6in p5.13/an13/t5in p5.14/an14/t4eud p5.15/an15/t2eud v ss v dd p2.0/cc0io p2.1/cc1io p2.2/cc2io p2.3/cc3io p2.4/cc4io p2.5/cc5io p2.6/cc6io p2.7/cc7io v ss dc1 p2.8/cc8io/ex0in p2.9/cc9io/ex1in p2.10/cc10ioex2in p2.11/cc11ioex3in p2.12/cc12io/ex4in p2.13/cc13io/ex5in p2.14/cc14io/ex6in p2.15/cc15io/ex7in/t7in p3.0/t0in p3.1/t6out p3.2/capin p3.3/t3out p3.4/t3eud p3.5/t4in v ss v dd v ss nmi v dd rstout rstin v ss xtal1 xtal2 v dd p1h.7/a15/cc27io p1h.6/a14/cc26io p1h.5/a13/cc25io p1h.4/a12/cc24io p1h.3/a11 p1h.2/a10 p1h.1/a9 p1h.0/a8 v ss v dd p1l.7/a7 p1l.6/a6 p1l.5/a5 p1l.4/a4 p1l.3/a3 p1l.2/a2 p1l.1/a1 p1l.0/a0 p0h.7/ad15 p0h.6/ad14 p0h.5/ad13 p0h.4/ad12 p0h.3/ad11 p0h.2/ad10 p0h.1/ad9 v ss v dd 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 108 107 106 105 104 103 102 101 100 99 98 97 96 95 94 93 92 91 90 89 88 87 86 85 84 83 82 81 80 79 78 77 76 75 74 73 144 143 142 141 140 139 138 137 136 135 134 133 132 131 130 129 128 127 126 125 124 123 122 121 120 119 118 117 116 115 114 113 112 111 110 109 st10f269-q3
st10f269 8/160 table 1 : pin description symbol pin type function p6.0 - p6.7 1 - 8 i/o 8-bit bidirectional i/o port, bit-wise programmable for input or output via direction bit. programming an i/o pin as input forces the corresponding output driver to high impedance state. port 6 outputs can be configured as push-pull or open drain drivers. the following port 6 pins have alternate functions: 1 o p6.0 cs0 chip select 0 output ... ... ... ... ... 5 o p6.4 cs4 chip select 4 output 6 i p6.5 hold external master hold request input 7 o p6.6 hlda hold acknowledge output 8 o p6.7 breq bus request output p8.0 - p8.7 9-16 i/o 8-bit bidirectional i/o port, bit-wise programmable for input or output via direction bit. programming an i/o pin as input forces the corresponding output driver to high impedance state. port 8 outputs can be configured as push-pull or open drain drivers. the input threshold of port 8 is selectable (ttl or special). the following port 8 pins have alternate functions: 9 i/o p8.0 cc16io capcom2: cc16 capture input / compare output ... ... ... ... ... 16 i/o p8.7 cc23io capcom2: cc23 capture input / compare output p7.0 - p7.7 19-26 i/o 8-bit bidirectional i/o port, bit-wise programmable for input or output via direction bit. programming an i/o pin as input forces the corresponding output driver to high impedance state. port 7 outputs can be configured as push-pull or open drain drivers. the input threshold of port 7 is selectable (ttl or special). the following port 7 pins have alternate functions: 19 o p7.0 pout0 pwm channel 0 output ... ... ... ... ... 22 o p7.3 pout3 pwm channel 3 output 23 i/o p7.4 cc28io capcom2: cc28 capture input / compare output ... ... ... ... ... 26 i/o p7.7 cc31io capcom2: cc31 capture input / compare output p5.0 - p5.9 p5.10 - p5.15 27-36 39-44 i i 16-bit input-only port with schmitt-trigger characteristics. the pins of port 5 can be the analog input channels (up to 16) for the a/d converter, where p5.x equals anx (analog input channel x), or they are timer inputs: 39 i p5.10 t6eud gpt2 timer t6 external up / down control input 40 i p5.11 t5eud gpt2 timer t5 external up / down control input 41 i p5.12 t6in gpt2 timer t6 count input 42 i p5.13 t5in gpt2 timer t5 count input 43 i p5.14 t4eud gpt1 timer t4 external up / down control input 44 i p5.15 t2eud gpt1 timer t2 external up / down control input
st10f269 9/160 p2.0 - p2.7 p2.8 - p2.15 47-54 57-64 i/o 16-bit bidirectional i/o port, bit-wise programmable for input or output via direction bit. programming an i/o pin as input forces the corresponding output driver to high impedance state. port 2 outputs can be configured as push-pull or open drain drivers. the input threshold of port 2 is selectable (ttl or special). the following port 2 pins have alternate functions: 47 i/o p2.0 cc0io capcom: cc0 capture input / compare output ... ... ... ... ... 54 i/o p2.7 cc7io capcom: cc7 capture input / compare output 57 i/o p2.8 cc8io capcom: cc8 capture input / compare output i ex0in fast external interrupt 0 input ... ... ... ... ... 64 i/o p2.15 cc15io capcom: cc15 capture input / compare output i ex7in fast external interrupt 7 input i t7in capcom2 timer t7 count input p3.0 - p3.5 p3.6 - p3.13, p3.15 65-70, 73-80, 81 i/o i/o i/o 15-bit (p3.14 is missing) bidirectional i/o port, bit-wise programmable for input or output via direction bit. programming an i/o pin as input forces the corresponding output driver to high impedance state. port 3 outputs can be configured as push-pull or open drain drivers. the input threshold of port 3 is selectable (ttl or special). the following port 3 pins have alternate functions: 65 i p3.0 t0in capcom timer t0 count input 66 o p3.1 t6out gpt2 timer t6 toggle latch output 67 i p3.2 capin gpt2 register caprel capture input 68 o p3.3 t3out gpt1 timer t3 toggle latch output 69 i p3.4 t3eud gpt1 timer t3 external up / down control input 70 i p3.5 t4in gpt1 timer t4 input for count / gate / reload / capture 73 i p3.6 t3in gpt1 timer t3 count / gate input 74 i p3.7 t2in gpt1 timer t2 input for count / gate / reload / capture 75 i/o p3.8 mrst ssc master-receiver / slave-transmitter i/o 76 i/o p3.9 mtsr ssc master-transmitter / slave-receiver o/i 77 o p3.10 txd0 asc0 clock / data output (asynchronous / synchronous) 78 i/o p3.11 rxd0 asc0 data input (asynchronous) or i/o (synchronous) 79 o p3.12 bhe external memory high byte enable signal wrh external memory high byte write strobe 80 i/o p3.13 sclk ssc master clock output / slave clock input 81 o p3.15 clkout system clock output (=cpu clock) symbol pin type function
st10f269 10/160 p4.0 Cp4.7 85-92 i/o port 4 is an 8-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bit. programming an i/o pin as input forces the corresponding output driver to high impedance state. the input threshold is selectable (ttl or special). port 4.6 & 4.7 outputs can be configured as push-pull or open drain drivers. in case of an external bus configuration, port 4 can be used to output the segment address lines: 85 o p4.0 a16 segment address line 86 o p4.1 a17 segment address line 87 o p4.2 a18 segment address line 88 o p4.3 a19 segment address line 89 o p4.4 a20 segment address line i can2_rxd can2 receive data input 90 o p4.5 a21 segment address line i can1_rxd can1 receive data input 91 o p4.6 a22 segment address line o can1_txd can1 transmit data output 92 o p4.7 a23 most significant segment address line o can2_txd can2 transmit data output rd 95 o external memory read strobe. rd is activated for every external instruction or data read access. wr /wrl 96 o external memory write strobe. in wr -mode this pin is activated for every external data write access. in wrl mode this pin is activated for low byte data write accesses on a 16-bit bus, and for every data write access on an 8-bit bus. see wrcfg in the syscon register for mode selection. ready/ ready 97 i ready input. the active level is programmable. when the ready function is enabled, the selected inactive level at this pin, during an external memory access, will force the insertion of waitstate cycles until the pin returns to the selected active level. ale 98 o address latch enable output. in case of use of external addressing or of multi- plexed mode, this signal is the latch command of the address lines. ea 99 i external access enable pin. a low level applied to this pin during and after reset forces the st10f269 to start the program from the external memory space. a high level forces the mcu to start in the internal memory space. symbol pin type function
st10f269 11/160 p0l.0 - p0l.7, p0h.0 p0h.1 - p0h.7 100-107, 108, 111-117 i/o two 8-bit bidirectional i/o ports p0l and p0h, bit-wise programmable for input or output via direction bit. programming an i/o pin as input forces the corresponding output driver to high impedance state. in case of an external bus configuration, port0 serves as the address (a) and as the address / data (ad) bus in multiplexed bus modes and as the data (d) bus in demultiplexed bus modes. demultiplexed bus modes data path width: 8-bit 16-bit p0l.0 C p0l.7: d0 C d7 d0 - d7 p0h.0 C p0h.7 i/o d8 - d15 multiplexed bus modes data path width: 8-bit 16-bit p0l.0 C p0l.7: a d0 C ad7 a d0 - ad7 p0h.0 C p0h.7 a 8 C a15 a d8 - ad15 p1l.0 - p1l.7 p1h.0 - p1h.7 118-125 128-135 i/o two 8-bit bidirectional i/o ports p1l and p1h, bit-wise programmable for input or output via direction bit. programming an i/o pin as input forces the corresponding output driver to high impedance state. port1 is used as the 16-bit address bus (a) in demultiplexed bus modes and also after switching from a demultiplexed bus mode to a multiplexed bus mode. the following port1 pins have alternate functions: 132 i p1h.4 cc24io capcom2: cc24 capture input 133 i p1h.5 cc25io capcom2: cc25 capture input 134 i p1h.6 cc26io capcom2: cc26 capture input 135 i p1h.7 cc27io capcom2: cc27 capture input xtal1 138 i xtal1 oscillator amplifier and/or external clock input. xtal2 137 o xtal2 oscillator amplifier circuit output. to clock the device from an external source, drive xtal1 while leaving xtal2 unconnected. minimum and maximum high / low and rise / fall times specified in the ac characteristics must be observed. rstin 140 i reset input with schmitt-trigger characteristics. a low level at this pin for a specified duration while the oscillator is running resets the st10f269. an internal pull-up resistor permits power-on reset using only a capacitor connected to v ss . in bidirec- tional reset mode (enabled by setting bit bdrsten in syscon register), the rstin line is pulled low for the duration of the internal reset sequence. rstout 141 o internal reset indication output. this pin is driven to a low level during hardware, software or watchdog timer reset. rstout remains low until the einit (end of ini- tialization) instruction is executed. nmi 142 i non-maskable interrupt input. a high to low transition at this pin causes the cpu to vector to the nmi trap routine. if bit pwdcfg = 0 in syscon register, when the pwrdn (power down) instruction is executed, the nmi pin must be low in order to force the st10f269 to go into power down mode. if nmi is high and pwdcfg =0, when pwrdn is executed, the part will continue to run in normal mode. if not used, pin nmi should be pulled high externally. v aref 37 - a/d converter reference voltage. v agnd 38 - a/d converter reference ground. rpd 84 - timing pin for the return from interruptible powerdown mode and synchronous / asynchronous reset selection. symbol pin type function
st10f269 12/160 v dd 46, 72, 82,93, 109, 126, 136, 144 - digital supply voltage: = + 5v during normal operation and idle mode. v ss 18,45, 55,71, 83,94, 110, 127, 139, 143 - digital ground. dc1 dc2 56 17 - - 3.3v decoupling pin: a decoupling capacitor of 3 330 nf must be connected between this pin and nearest v ss pin. symbol pin type function
st10f269 13/160 3 - functional description the architecture of the st10f269 combines advantages of both risc and cisc processors and an advanced peripheral subsystem. the block diagram gives an overview of the different on-chip components and the high bandwidth internal bus structure of the st10f269. figure 3 : block diagram p4.7 can2_txd p4.6 can1_txd p4.5 can1_rxd p4.4 can2_rxd port 0 por t 1 por t 4 port 6 port 5 port 3 port 2 gpt1 gpt2 asc usart brg cpu-core and mac unit internal ram watchdog interrupt controller 8 32 16 pec 16 16 can1 port 7 port 8 external bus 10-bit adc brg ssc pwm capcom2 capcom1 16 oscillator controller 16 16 256k byte and pll flash memory xtal1 xtal2 2k byte 16 15 8 8 8 16 3.3v voltage regulator 10k byte xram can2
st10f269 14/160 4 - memory organization the memory space of the st10f269 is configured in a unified memory architecture. code memory, data memory, registers and i/o ports are organized within the same linear address space of 16m bytes. the entire memory space can be accessed byte wise or word wise. particular portions of the on-chip memory have additionally been made directly bit addressable. flash: 256k bytes of on-chip flash memory. iram: 2k bytes of on-chip internal ram (dual-port) is provided as a storage for data, system stack, general purpose register banks and code. a register bank is 16 wordwide (r0 to r15) and / or bytewide (rl0, rh0, , rl7, rh7) general purpose registers. xram: 10k bytes of on-chip extension ram (single port xram) is provided as a storage for data, user stack and code. the xram is divided into 2 areas, the first 2k bytes named xram1 and the second 8k bytes named xram2, connected to the internal xbus and are accessed like an external memory in 16-bit demultiplexed bus-mode without wait state or read/write delay (50ns access at 40mhz cpu clock). byte and word accesses are allowed. the xram1 address range is 00e000h - 00e7ffh if xpen (bit 2 of syscon register), and xram1en (bit 2 of xpercon register) are set. if xram1en or xpen is cleared, then any access in the address range 00e000h - 00e7ffh will be directed to external memory interface, using the busconx register corresponding to address matching addrselx register the xram2 address range is 00c000h - 00dfffh if xpen (bit 2 of syscon register), and xram2 (bit 3 of xpercon register are set). if bit xram2en or xpen is cleared, t hen any access in the address range 00c000h - 00dfffh will be directed to external memory interface, using the busconx register corresponding to address matching addrselx register. as the xram appears like external memory, it cannot be used as system stack or as register banks. the xram is not provided for single bit storage and therefore is not bit addressable. sfr/esfr : 1024 bytes (2 x 512 bytes) of address space is reserved for the special function register areas. sfrs are wordwide registers which are used to control and to monitor the function of the different on-chip units. can1: address range 00ef00h - 00efffh is reserved for the can1 module access. the can1 is enabled by setting xpen bit 2 of the syscon register and by setting can1en bit 0 of the new xpercon register. accesses to the can module use demultiplexed addresses and a 16-bit data bus (byte accesses are possible). two wait states give an access time of 100ns at 40mhz cpu clock. no tri-state wait states are used. can2: address range 00ee00h - 00eeffh is reserved for the can2 module access. the can2 is enabled by setting xpen bit 2 of the syscon register and by setting can2en bit 1 of the new xpercon register. accesses to the can module use demultiplexed addresses and a 16-bit data bus (byte accesses are possible). two wait states give an access time of 100ns at 40mhz cpu clock. no tri-state wait states are used. in order to meet the needs of designs where more memory is required than is provided on chip, up to 16m bytes of external ram and/or rom can be connected to the microcontroller. note if one or the two can modules are used, port 4 cannot be programmed to output all 8 segment address lines. thus, only 4 segment address lines can be used, reducing the external memory space to 5m bytes (1m byte per cs line). visibility of xbus peripherals in order to keep the st10f269 compatible with the st10c167 and with the st10f167, the xbus peripherals can be selected to be visible and / or accessible on the external address / data bus. can1en and can2en bits of xpercon register must be set. if these bits are cleared before the global enabling with xpen-bit in syscon register, the corresponding address space, port pins and interrupts are not occupied by the peripheral, thus the peripheral is not visible and not available. refer to chapter 20 - special function register overview.
st10f269 15/160 figure 4 : st10f269 on-chip memory mapping 14 07 06 05 04 004000 01 00 000000 02 00c000 00ffff sfr : 512 bytes 00fe00 00fdff iram : 2k bytes 00f600 * bank 0l may be remapped from segment 0 to segment 1 (bank 1l) by setting syscon-roms1 (before einit) ram, sfr and x-pheripherals are mapped into the address space. segment 4 segment 3 segment 2 segment 1 segment 0 data page number absolute memory address 006000 00f1ff esfr : 512 bytes 00f000 00efff can1 : 256 bytes 00ef00 00eeff can2 : 256 bytes 00ee00 00e7ff xram1 : 2k bytes 00e000 00dfff xram2 : 8k bytes 00c000 03 00ec14 real time clock 00ec00 block2 = 8k bytes internal flash memory block1 = 8k bytes block0 = 16k bytes bank ol 010000 018000 020000 030000 0c 040000 10 050000 block6 = 64k bytes block5 = 64k bytes block4 = 64k bytes block3 = 32k bytes block2* block1* block0* bank 1l bank 1h data page number and absolute memory address are hexadecimal values. 08
st10f269 16/160 xpercon (f024h / 12h) esfr reset value: - - 05h note: - when both can are disabled via xper- con setting, then any access in the address range 00ee00h - 00efffh will be directed to external memory interface, using the busconx register correspond- ing to address matching addrselx regis- ter. p4.4 and p4.7 can be used as general purpose i/o when can2 is disabled, and p4.5 and p4.6 can be used as general purpose i/o when can1 is disabled. - the default xper selection after reset is identical to xbus configuration of st10c167: xcan1 is enabled, xcan2 is disabled, xram1 (2k byte compatible xram) is enabled, xram2 (new 8k byte xram) is disabled. - register xpercon cannot be changed after the global enabling of xperipherals, i.e. after the setting of bit xpen in the syscon register. - in emulation mode, all the xperipherals are enabled ( xpercon bit are all set). the access to external memory and/or xbus is controlled by the bondout chip. - when the real time clock is disabled (rtcen = 0), the clock oscillator is switch-off if the st10 enters in power-down mode. otherwise, when the real time clock is enabled, the bit rtcoff of the rtccon register allows to choose the power-down mode of the clock oscillator (see chapter 16 - real time clock). 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - -------- -- rtcen xram2en xram1en can2en can1en rw rw rw rw rw can1en can1 enable bit 0: accesses to the on-chip can1 xperipheral and its functions are disabled. p4.5 and p4.6 pins can be used as general purpose i/os. address range 00ef00h-00efffh is only directed to external memory if can2en is also 0. 1: the on-chip can1 xperipheral is enabled and can be accessed. can2en can2 enable bit 0: accesses to the on-chip can2 xperipheral and its functions are disabled. p4.4 and p4.7 pins can be used as general purpose i/os. address range 00ee00h-00eeffh is only directed to external memory if can1en is also 0. 1: the on-chip can2 xperipheral is enabled and can be accessed. xram1en xram1 enable bit 0: accesses to external memory within space 00e000h to 00e7ffh. the 2k bytes of internal xram1 are disabled. 1: accesses to the internal 2k bytes of xram1. xram2en xram2 enable bit 0: accesses to the external memory within space 00c000h to 00dfffh. the 8k bytes of internal xram2 are disabled. 1: accesses to the internal 8k bytes of xram2. rtcen rtc enable bit 0: accesses to the on-chip real time clock are disabled, external access is performed. address range 00ec00h-00ecffh is only directed to external memory if can1en and can2en are 0 also 1: the on-chip real time clock is enabled and can be accessed.
st10f269 17/160 5 - internal flash memory 5.1 - overview C 256k byte on-chip flash memory C two possibilities of flash mapping into the cpu address space C flash memory can be used for code and data storage C 32-bit, zero waitstate read access (50ns cycle time at f cpu = 40mhz) C erase-program controller (epc) similar to m29f400b stms stand-alone flash memory ? word-by-word programmable (16 m s typical) ? data polling and toggle protocol for epc status ? ready/busy signal connected on xp2int interrupt line ? internal power-on detection circuit C memory erase in blocks ? one 16k byte, two 8k byte, one 32k byte, three 64k byte blocks ? each block can be erased separately (1.5 second typical) ? chip erase (8.5 second typical) ? each block can be separately protected against programming and erasing ? each protected block can be temporary unpro- tected ? when enabled, the read protection prevents access to data in flash memory using a pro- gram running out of the flash memory space. access to data of internal flash can only be per- formed with an inner protected program C erase suspend and resume modes ? read and program another block during erase suspend C single voltage operation , no need of dedicated supply pin C low power consumption: ? 45ma max. read current ? 60ma max. program or erase current ? automatic stand-by-mode (50 m a maximum) C 100,000 erase-program cycles per block, 20 years of data retention time C operating temperature: -40 to +125 o c 5.2 - operational overview read mode in standard mode (the normal operating mode) the flash appears like an on-chip rom with the same timing and functionality. the flash module offers a fast access time, allowing zero waitstate access with cpu frequency up to 40mhz. instruction fetches and data operand reads are performed with all addressing modes of the st10f269 instruction set. in order to optimize the programming time of the internal flash, blocks of 8k bytes, 16k bytes, 32k bytes, 64k bytes can be used. but the size of the blocks does not apply to the whole memory space, see details in table 2. table 2 : 256k byte flash memory block organisation block addresses (segment 0) addresses (segment 1) size (byte) 0 1 2 3 4 5 6 000000h to 003fffh 004000h to 005fffh 006000h to 007fffh 018000h to 01ffffh 020000h to 02ffffh 030000h to 03ffffh 040000h to 04ffffh 010000h to 013fffh 014000h to 015fffh 016000h to 017fffh 018000h to 01ffffh 020000h to 02ffffh 030000h to 03ffffh 040000h to 04ffffh 16k 8k 8k 32k 64k 64k 64k
st10f269 18/160 instructions and commands all operations besides normal read operations are initiated and controlled by command sequences written to the flash command interface (ci). the command interface (ci) interprets words written to the flash memory and enables one of the following operations: C read memory array C program word C block erase C chip erase C erase suspend C erase resume C block protection C block temporary unprotection C code protection commands are composed of several write cycles at specific addresses of the flash memory. the different write cycles of such command sequences offer a fail-safe feature to protect against an inadvertent write. a command only starts when the command interface has decoded the last write cycle of an operation. until that last write is performed, flash memory remains in read mode notes: 1. as it is not possible to perform write operations in the flash while fetching code from flash, the flash commands must be written by instructions executed from internal ram or external memory. 2. command write cycles do not need to be consecutively received, pauses are allowed, save for block erase command. during this operation all erase confirm commands must be sent to complete any block erase operation before time-out period expires (typically 96 m s). command sequencing must be followed exactly. any invalid combination of commands will reset the command interface to read mode. status register this register is used to flag the status of the memory and the result of an operation. this register can be accessed by read cycles during the erase-program controller (epc) operation. erase operation this flash memory features a block erase architecture with a chip erase capability too. erase is accomplished by executing the six cycle erase command sequence. additional command write cycles can then be performed to erase more than one block in parallel. when a time-out period elaps (96 m s) after the last cycle, the erase-program controller (epc) automatically starts and times the erase pulse and executes the erase operation. there is no need to program the block to be erased with 0000h before an erase operation. termination of operation is indicated in the flash status register. after erase operation, the flash memory locations are read as 'ffffh value. erase suspend a block erase operation is typically executed within 1.5 second for a 64k byte block. erasure of a memory block may be suspended, in order to read data from another block or to program data in another block, and then resumed. in-system programming in-system programming is fully supported. no special programming voltage is required. because of the automatic execution of erase and programming algorithms, write operations are reduced to transferring commands and data to the flash and reading the status. any code that programs or erases flash memory locations (that writes data to the flash) must be executed from memory outside the on-chip flash memory itself (on-chip ram or external memory). a boot mechanism is provided to support in-system programming. it works using serial link via usart interface and a pc compatible or other programming host. read/write protection the flash module supports read and write protection in a very comfortable and advanced protection functionality. if read protection is installed, the whole flash memory is protected against any "external" read access; read accesses are only possible with instructions fetched directly from program flash memory. for update of the flash memory a temporary disable of flash read protection is supported. the device also features a block write protection. software locking of selectable memory blocks is provided to protect code and data. this feature will disable both program and erase operations in the selected block(s) of the memory. block protection is accomplished by block specific lock-bit which are programmed by executing a four cycle command sequence. the locked state of blocks is indicated by specific flags in the according block status registers. a block may only be temporarily unlocked for update (write) operations.
st10f269 19/160 with the two possibilities for write protection - whole memory or block specific - a flexible installation of write protection is supported to protect the flash memory or parts of it from unauthorized programming or erase accesses and to provide virus-proof protection for all system code blocks. all write protection also is enabled during boot operation. power supply, reset the flash module uses a single power supply for both read and write functions. internally generated and regulated voltages are provided for the program and erase operations from 5v supply. once a program or erase cycle has been completed, the device resets to the standard read mode. at power-on, the flash memory has a setup phase of some microseconds (dependent on the power supply ramp-up). during this phase, flash can not be read. thus, if ea pin is high (execution will start from flash memory), the cpu will remains in reset state until the flash can be accessed. 5.3 - architectural description the flash module distinguishes two basic operating modes, the standard read mode and the command mode. the initial state after power-on and after reset is the standard read mode. 5.3.1 - read mode the flash module enters the standard operating mode, the read mode: C after reset command C after every completed erase operation C after every completed programming operation C after every other completed command execution C few microseconds after a cpu-reset has started C after incorrect address and data values of command sequences or writing them in an improper sequence C after incorrect write access to a read protected flash memory the read mode remains active until the last command of a command sequence is decoded which starts directly a flash array operation, such as: C erase one or several blocks C program a word into flash array C protect / temporary unprotect a block. in the standard read mode read accesses are directly controlled by the flash memory array, delivering a 32-bit double word from the addressed position. read accesses are always aligned to double word boundaries. thus, both low order address bit a1 and a0 are not used in the flash array for read accesses. the high order address bit a17/a16 define the physical 64k byte segment being accessed within the flash array. 5.3.2 - command mode every operation besides standard read operations is initiated by commands written to the flash command register. the addresses used for command cycles define in conjunction with the actual state the specific step within command sequences. with the last command of a command sequence, the erase-program controller (epc) starts the execution of the command. the epc status is indicated during command execution by: C the status register, C the ready/busy signal. 5.3.3 - ready/busy signal the ready/busy (r /b) signal is connected to the xper2 interrupt node (xp2ic). when r /b is high, the flash is busy with a program or erase operation and will not accept any additional program or erase instruction. when r /b is low, the flash is ready for any read/write or erase operation. the r /b will also be low when the memory is put in erase suspend mode. this signal can be polled by reading xp2ic register, or can be used to trigger an interrupt when the flash goes from busy to ready. 5.3.4 - flash status register the flash status register is used to flag the status of the flash memory and the result of an operation. this register can be accessed by read cycles during the program-erase controller operations. the program or erase operation can be controlled by data polling on bit fsb.7 of status register, detection of toggle on fsb.6 and fsb.2, or error on fsb.5 and erase timeout on fsb.3 bit. any read attempt in flash during epc operation will automatically output these five bits. the epc sets bit fsb.2, fsb.3, fsb.5, fsb.6 and fsb.7. other bits are reserved for future use and should be masked.
st10f269 20/160 flash status (see note for address) note: the address of flash status register is the address of the word being programmed when programming operation is in progress, or an address within block being erased when erasing operation is in progress. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ------- - fsb.7 fsb.6 fsb.5 - fsb.3 fsb.2 - - rrr r r fsb.7 flash status bit 7: data polling bit programming operation: this bit outputs the complement of the bit 7 of the word being programmed, and after completion, will output the bit 7 of the word programmed. erasing operation: outputs a 0 during erasing, and 1 after erasing completion. if the block selected for erasure is (are) protected, fsb.7 will be set to 0 for about 100 s, and then return to the previous addressed memory data value. fsb.7 will also flag the erase suspend mode by switching from 0 to 1 at the start of the erase suspend. during program operation in erase suspend mode, fsb.7 will have the same behaviour as in normal program execution outside the suspend mode. fsb.6 flash status bit 6: toggle bit programming or erasing operations: successive read operations of flash status register will deliver complementary values. fsb.6 will toggle each time the flash status register is read. the program operation is completed when two successive reads yield the same value. the next read will output the bit last programmed, or a 1 after erase operation fsb.6 will be set to1 if a read operation is attempted on an erase suspended block. in addition, an erase suspend/resume command will cause fsb.6 to toggle. fsb.5 flash status bit 5: error bit this bit is set to 1 when there is a failure of program, block or chip erase operations.this bit will also be set if a user tries to program a bit to 1 to a flash location that is currently programmed with 0. the error bit resets after read/reset instruction. in case of success, the error bit will be set to 0 during program or erase and then will output the bit last programmed or a 1 after erasing fsb.3 flash status bit 3: erase time-out bit this bit is cleared by the epc when the last block erase command has been entered to the command interface and it is awaiting the erase start. when the time-out period is finished, after 96 s, fsb.3 returns back to 1. fsb.2 flash status bit 2: toggle bit this toggle bit, together with fsb.6, can be used to determine the chip status during the erase mode or erase suspend mode. it can be used also to identify the block being erased suspended. a read operation will cause fsb.2 to toggle during the erase mode. if the flash is in erase suspend mode, a read operation from the erase suspended block or a program operation into the erase suspended block will cause fsb.2 to toggle. when the flash is in program mode during erase suspend, fsb.2 will be read as 1 if address used is the address of the word being programmed. after erase completion with an error status, fsb.2 will toggle when reading the faulty sector.
st10f269 21/160 5.3.5 - flash protection register the flash protection register is a non-volatile register that contains the protection status. this register can be read by using the read protection status (rp) command, and programmed by using the dedi- cated set protection command. flash protection register (pr) 5.3.6 - instructions description twelve instructions dedicated to flash memory accesses are defined as follow: read/reset (rd). the read/reset instruction consist of one write cycle with data xxf0h . it can be optionally preceded by two ci enable coded cycles (data xxa8h at address 1554h + data xx54h at address 2aa8h). any successive read cycle following a read/reset instruction will read the memory array. a wait cycle of 10s is necessary after a read/reset command if the memory was in program or erase mode. program word (pw). this instruction uses four write cycles. after the two cl enable coded cycles, the program word command xxa0h is written at address 1554h. the following write cycle will latch the address and data of the word to be programmed. memory programming can be done only by writing 0's instead of 1's, otherwise an error occurs. during programming, the flash status is checked by reading the flash status bit fsb.2, fsb.5, fsb.6 and fsb.7 which show the status of the epc. fsb.2, fsb.6 and fsb.7 determine if programming is on going or has completed, and fsb.5 allows a check to be made for any possible error. block erase (be). this instruction uses a minimum of six command cycles. the erase enable command xx80h is written at address 1554h after the two-cycle ci enable sequence. the erase confirm code xx30h must be written at an address related to the block to be erased preceded by the execution of a second ci enable sequence. additional erase confirm codes must be given to erase more than one block in parallel. additional erase confirm commands must be written within a defined time-out period. the input of a new block erase command will restart the time-out period. when this time-out period has elapsed, the erase starts. the status of the internal timer can be monitored through the level of fsb.3, if fsb.3 is 0, the block erase command has been given and the timeout is running; if fsb.3 is 1, the timeout has expired and the epc is erasing the block(s). 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 cp - - - - - - - - bp6 bp5 bp4 bp3 bp2 bp1 bp0 bpx block x protection bit (x = 0...6) 0: the block protection is enabled for block x. programming or erasing the block is not possible, unless a block temporary unprotection command is issued. 1: the block protection is disabled for block x. bit is 1 by default, and can be programmed permanently to 0 using the set protection command but then cannot be set to 1 again. it is therefore possible to temporally disable the block protection using the block temporary unprotection instruction. cp code protection bit 0: the flash code protection is enabled. read accesses to the flash for execution not performed in the flash itself are not allowed, the returned value will be 009bh, whatever the content of the flash is. 1: the flash code protection is disabled: read accesses to the flash from external or internal ram are allowed bit is 1 by default, and can be programmed permanently to 0 using the set protection command but then cannot be set to 1 again. it is therefore possible to temporally disable the code protection using the code temporary unprotection instruction.
st10f269 22/160 if the second command given is not an erase confirm or if the coded cycles are wrong, the instruction aborts, and the device is reset to read mode. it is not necessary to program the block with 0000h as the epc will do this automatically before the erasing to ffffh. read operations after the epc has started, output the flash status register. during the execution of the erase by the epc, the device accepts only the erase suspend and read/reset instructions. data polling bit fsb.7 returns 0 while the erasure is in progress, and 1 when it has completed. the toggle bit fsb.2 and fsb.6 toggle during the erase operation. they stop when erase is completed. after completion, the error bit fsb.5 returns 1 if there has been an erase failure because erasure has not completed even after the maximum number of erase cycles have been executed by the epc, in this case, it will be necessary to input a read/reset to the command interface in order to reset the epc. chip erase (ce) . this instruction uses six write cycles. the erase enable command xx80h, must be written at address 1554h after ci-enable cycles. the chip erase command xx10h must be given on the sixth cycle after a second ci-enable sequence. an error in command sequence will reset the ci to read mode. it is not necessary to program the block with 0000h as the epc will do this automatically before the erasing to ffffh. read operations after the epc has started output the flash status register. during the execution of the erase by the epc, data polling bit fsb.7 returns 0 while the erasure is in progress, and 1 when it has completed. the fsb.2 and fsb.6 bit toggle during the erase operation. they stop when erase is finished. the fsb.5 error bit returns "1" in case of failure of the erase operation. the error flag is set after the maximum number of erase cycles have been executed by the epc. in this case, it will be necessary to input a read/reset to the command interface in order to reset the epc. erase suspend (es). this instruction can be used to suspend a block erase operation by giving the command xxb0h without any specific address. no ci-enable cycles is required. erase suspend operation allows reading of data from another block and/or the programming in another block while erase is in progress. if this command is given during the time-out period, it will terminate the time-out period in addition to erase suspend. the toggle bit fsb.6, when monitored at an address that belongs to the block being erased, stops toggling when erase suspend command is effective, it happens between 0.1 m s and 15 m s after the erase suspend command has been written. the flash will then go in normal read mode, and read from blocks not being erased is valid, while read from block being erased will output fsb.2 toggling. during a suspend phase the only instructions valid are erase resume and program word. a read / reset instruction during erase suspend will definitely abort the erase and result in invalid data in the block being erased. erase resume (er). this instruction can be given when the memory is in erase suspend state. erase can be resumed by writing the command xx30h at any address without any cl-enable sequence. program during erase suspend. the program word instruction during erase suspend is allowed only on blocks that are not erase-suspended. this instruction is the same than the program word instruction. set protection (sp). this instruction can be used to enable both block protection (to protect each block independently from accidental erasing-pro- gramming operation) and code protection (to avoid code dump). the set protection command must be given after a special ci-protection enable cycles (see instruction table). the following write cycle, will program the protection register. to pro- tect the block x (x = 0 to 6), the data bit x must be at 0. to protect the code, bit 15 of the data must be 0. enabling block or code protection is per- manent and can be cleared only by stm. block temporary unprotection and code temporary unprotection instructions are available to allow the customer to update the code. notes: 1. the new value programmed in protection register will only become active after a reset. 2. bit that are already at 0 in protection register must be confirmed at 0 also in data latched during the 4th cycle of set protection command, otherwise an error may occur. read protection status (rp). this instruction is used to read the block protection status and the code protection status. to read the protection register (see table 3), the ci-protection enable cycles must be executed followed by the command xx90h at address x2a54h. the following read cycles at any odd word address will output the block protection status. the read/ reset command xxf0h must be written to reset the protection interface. note: after a modification of protection register (using set protection command), the read protection status will return the new pr value only after a reset.
st10f269 23/160 block temporary unprotection (btu). this instruction can be used to temporary unprotect all the blocks from program / erase protection. the unprotection is disabled after a reset cycle. the block temporary unprotection command xxc1h must be given to enable block temporary unprotection. the command must be preceded by the ci-protection enable cycles and followed by the read/reset command xxf0h. set code protection (scp). this kind of protection allows the customer to protect the proprietary code written in flash. if installed and active, flash code protection prevents data operand accesses and program branches into the on-chip flash area from any location outside the flash memory itself. data operand accesses and branches to flash locations are only and exclusively allowed for instructions executed from the flash memory itself. every read or jump to flash performed from another memory (like internal ram, external memory) while code protection is enabled, will give the opcode 009bh related to trap #00 illegal instruction. the ci-protection enable cycles must be sent to set the code protection. by writing data 7fffh at any odd word address, the code protected status is stored in the flash protection register (pr). protection is permanent and cannot be cleared by the user. it is possible to temporarily disable the code protection using code temporary unprotection instruction. note: bits that are already at 0 in protection register must be confirmed at 0 also in data latched during the 4th cycle of set protection command, otherwise an error may occur. code temporary unprotection (ctu). this instruction must be used to temporary disable code protection. this instruction is effective only if executed from flash memory space. to restore the protection status, without using a reset, it is necessary to use a code temporary protection instruction. system reset will reset also the code temporary unprotected status. the code temporary unprotection command consists of the following write cycle: mov mem, rn ; this instruction must be executed from flash memory space where mem is an absolute address inside memory space, rn is a register loaded with data 0ffffh. code temporary protection (ctp). this instruction allows to restore code protection. this operation is effective only if executed from flash memory and is necessary to restore the protection status after the use of a code temporary unprotection instruction. the code temporary protection command consists of the following write cycle: mov mem, rn ; this instruction must be executed from flash memory space where mem is an absolute address inside memory space, rn is a register loaded with data 0fffbh. note that code temporary unprotection instruction must be used when it is necessary to modify the flash with protected code (scp), since the write/erase routines must be executed from a memory external to flash space. usually, the write/erase routines, executed in ram, ends with a return to flash space where a ctp instruction restore the protection.
st10f269 24/160 table 3 : instructions notes 1. address bit a14, a15 and above are dont care for coded address inputs. 2. x = dont care. 3. wa = write address: address of memory location to be programmed. 4. wd = write data: 16-bit data to be programmed 5. optional, additional blocks addresses must be entered within a time-out delay (96 s) after last write entry, timeout status can be verified through fsb.3 value. when full command is entered, read data polling or toggle bit until erase is completed or suspend ed. 6. read data polling or toggle bit until erase completes. 7. wpr = write protection register. to protect code, bit 15 of wpr must be 0. to protect block n (n=0,1,...), bit n of wpr mu st be 0. bit that are already at 0 in protection register must also be 0 in wpr, else a writing error will occurs (it is not po ssible to write a 1 in a bit already programmed at 0). 8. mem = any address inside the flash memory space. absolute addressing mode must be used (mov mem, rn), and instruction must be executed from flash memory space. 9. odd word address = 4n-2 where n = 0, 1, 2, 3..., ex. 0002h, 0006h... instruction mne cycle 1 st cycle 2 nd cycle 3 rd cycle 4 th cycle 5 th cycle 6 th cycle 7 th cycle read/reset rd 1+ addr. 1 x 2 read memory array until a new write cycle is initiated data xxf0h read/reset rd 3+ addr. 1 x1554h x2aa8h xxxxxh read memory array until a new write cycle is initiated data xxa8h xx54h xxf0h program word pw 4 addr. 1 x1554h x2aa8h x1554h wa 3 read data polling or tog- gle bit until program com- pletes. data xxa8h xx54h xxa0h wd 4 block erase be 6 addr. 1 x1554h x2aa8h x1554h x1554h x2aa8h ba ba 5 data xxa8h xx54h xx80h xxa8h xx54h xx30h xx30h chip erase ce 6 addr. 1 x1554h x2aa8h x1554h x1554h x2aa8h x1554h note 6 data xxa8h xx54h xx80h xxa8h xx54h xx10h erase suspend es 1 addr. 1 x 2 read until toggle stops, then read or program all data needed from block(s) not being erased then resume erase. data xxb0h erase resume er 1 addr. 1 x 2 read data polling or toggle bit until erase completes or erase is supended another time. data xx30h set block/code protection sp 4 addr. 1 x2a54h x15a8h x2a54h any odd word address 9 data xxa8h xx54h xxc0h wpr 7 read protection status rp 4 addr. 1 x2a54h x15a8h x2a54h any odd word address 9 read protection register until a new write cycle is initiated. data xxa8h xx54h xx90h read pr block temporary unprotection btu 4 addr. 1 x2a54h x15a8h x2a54h x 2 data xxa8h xx54h xxc1h xxf0h code temporary unprotection ctu 1 addr. 1 mem 8 write cycles must be executed from flash. data ffffh code temporary protection ctp 1 addr. 1 mem 8 write cycles must be executed from flash. data fffbh
st10f269 25/160 C generally, command sequences cannot be written to flash by instructions fetched from the flash itself. thus, the flash commands must be written by instructions, executed from internal ram or external memory. C command cycles on the cpu interface need not to be consecutively received (pauses allowed). the cpu interface delivers dummy read data for not used cycles within command sequences. C all addresses of command cycles shall be defined only with register-indirect addressing mode in the according move instructions. direct addressing is not allowed for command sequences. address segment or data page pointer are taken into account for the command address value. 5.3.7 - reset processing and initial state the flash module distinguishes two kinds of cpu reset types the lengthening of cpu reset: C is not reported to external devices by bidirectional pin C is not enabled in case of external start of cpu after reset. 5.4 - flash memory configuration the default memory configuration of the st10f269 memory is determined by the state of the ea pin at reset. this value is stored in the internal rom enable bit (named romen) of the syscon register. when romen = 0, the internal flash is disabled and external rom is used for startup control. flash memory can later be enabled by setting the romen bit of syscon to 1. the code performing this setting must not run from a segment of the external rom to be replaced by a segment of the flash memory, otherwise unexpected behaviour may occur. for example, if external rom code is located in the first 32k bytes of segment 0, the first 32k bytes of the flash must then be enabled in segment 1. this is done by setting the roms1 bit of syscon to 0 before or simultaneously with setting of romen bit. this must be done in the externally supplied program before the execution of the einit instruction. if program execution starts from external memory, but access to the flash memory mapped in segment 0 is later required, then the code that performs the setting of romen bit must be executed either in the segment 0 but above address 008000h, or from the internal ram. bit roms1 only affects the mapping of the first 32k bytes of the flash memory. all other parts of the flash memory (addresses 018000h - 04ffffh) remain unaffected. the sgtdis segmentation disable / enable must also be set to 0 to allow the use of the full 256k bytes of on-chip memory in addition to the external boot memory. the correct procedure on changing the segmentation registers must also be observed to prevent an unwanted trap condition: C instructions that configure the internal memory must only be executed from external memory or from the internal ram. C an absolute inter-segment jump (jmps) instruction must be executed after flash enabling, to the next instruction, even if this next instruction is located in the consecutive address. C whenever the internal memory is disabled, enabled or remapped, the dpps must be explicitly (re)loaded to enable correct data accesses to the internal memory and/or external memory. 5.5 - application examples 5.5.1 - handling of flash addresses all command, block, data and register addresses to the flash have to be located within the active flash memory space. the active space is that address range to which the physical flash addresses are mapped as defined by the user. when using data page pointer (dpp) for block addresses make sure that address bit a15 and a14 of the block address are reflected in both lsbs of the selected dpps. note: - for command instructions, address bit a14, a15, a16 and a17 are dont care. this simplify a lot the application software, because it minimize the use of dpp regis- ters when using command in the com- mand interface. - direct addressing is not allowed for command sequence operations to the flash. only register-indirect addressing can be used for command, block or write-data accesses.
st10f269 26/160 5.5.2 - basic flash access control when accessing the flash all command write addresses have to be located within the active flash memory space. the active flash memory space is that logical address range which is covered by the flash after mapping. when using data page pointer (dpp) for addressing the flash, make sure that address bit a15 and a14 of the command addresses are reflected in both lsbs of the selected data page pointer (a15 - dppx.1 and a14 - dppx.0). in case of the command write addresses, address bit a14, a15 and above are dont care. thus, command writes can be performed by only using one dpp register. this allow to have a more simple and compact application software. another - advantageous - possibility is to use the extended segment instruction for addressing. note: the direct addressing mode is not allowed for write access to the flash address/command register. be aware that the c compiler may use this kind of addressing. for write accesses to flash module always the indirect addressing mode has to be selected. the following basic instruction sequences show examples for different addressing possibilities. principle example of address generation for flash commands and registers: when using data page pointer (dpp0 is this example) mov dpp0,#08h ;adjust data page pointers according to the ;addresses: dpp0 is used in this example, thus ;address must have a14 and a15 bit set to 0. mov rw m ,#address ;address could be a dedicated command sequence ;address 2aa8h, 1554h ... ) or the flash write ;address mov rw n ,#data ;data could be a dedicated command sequence data ;(xxa0h,xx80h ... ) or data to be programmed mov [rw m ],rw n ; indirect addressing when using the extended segment instruction: mov rw m ,#address ;address could be a dedicated command sequence ;address (2aa8h, 1554h ... ) or the flash write ;address mov rw o ,#data ;data could be a dedicated command sequence data ;(xxa0h,xx80h ... ) or data to be programmed mov rw n ,#segment ;the value of segment represents the segment ;number and could be 0, 1, 2, 3 or 4 (depending ;on sector mapping) for 256kbyte flash. exts rw n ,#length ;the value of rwn determines the 8-bit segment ;valid for the corresponding data access for any ;long or indirect address in the following(s) ;instruction(s). length defines the number of ;the effected instruction(s) and has to be a value ;between 1...4 mov [rw m ],rw o ; indirect addressing with segment number from ;exts
st10f269 27/160 5.5.3 - programming examples most of the microcontroller programs are written in the c language where the data page pointers are automatically set by the compiler. but because the c compiler may use the not allowed direct addressing mode for flash write addresses, it is necessary to program the organisational flash accesses (command sequences) with assembler in-line routines which use indirect addressing. example 1 performing the command read/reset we assume that in the initialization phase the lowest 32k bytes of flash memory (sector 0) have been mapped to segment 1. according to the usual way of st10 data addressing with data page pointers, address bit a15 and a14 of a 16-bit command write address select the data page pointer (dpp) which contains the upper 10-bit for building the 24-bit physical data address. address bit a13...a0 represent the address offset. as the bit a14...a17 are "dont care" when written a flash command in the command interface (ci), we can choose the most conveniant dppx register for address handling. the following examples are making usage of dpp0. we just have to make sure, that dpp0 points to active flash memory space. to be independent of mapping of sector 0 we choose for all dpps which are used for flash address handling, to point to segment 2. for this reason we load dpp0 with value 08h (00 0000 l000b). mov r5, #01554h ;load auxilary register r5 with command address ;(used in command cycle 1) mov r6, #02aa8h ;load auxilary register r6 with command address ;(used in command cycle 2) scxt dppo, #08h ;push data page pointer 0 and load it to point to ;segment 2 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 1 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 2 mov r7, #0f0h ;load register r7 with read/reset command mov [r5], r7 ;command cycle 3. address is dont care pop dpp0 ;restore dpp0 value in the example above the 16-bit registers r5 and r6 are used as auxilary registers for indirect addressing. example 2 performing a program word command we assume that in the initialization phase the lowest 32k bytes of flash memory (sector 0) have been mapped to segment 1.the data to be written is loaded in register r13, the address to be programmed is loaded in register r11/r12 (segment number in r11, segment offset in r12). mov r5, #01554h ;load auxilary register r5 with command address ;(used in command cycle 1) mov r6, #02aa8h ;load auxilary register r6 with command address ;(used in command cycle 2) sxct dppo, #08h ;push data page pointer 0 and load it to point to ;segment 2 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 1 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 2 mov r7, #0a0h ;load register r7 with program word command mov [r5], r7 ;command cycle 3
st10f269 28/160 pop dpp0 ;restore dpp0: following addressing to the flash ;will use extended instructions ;r11 contains the segment to be programmed ;r12 contains the segment offset address to be ;programmed ;r13 contains the data to be programmed exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r13 ;command cycle 4: the epc starts execution of ;programming command data_polling: exts r11, #1 ;use extended addressing for next mov instruction mov r7, [r12] ;read flash status register (fsb) in r7 mov r6, r7 ;save it in r6 register ;check if fsb.7 = data.7 (i.e. r7.7 = r13.7) xor r7, r13 jnb r7.7, prog_ok ;check if fsb.5 = 1 (programming error) jnb r6.5, data_polling ;programming error: verify is flash programmed ;data is ok exts r11, #1 ;use extended addressing for next mov instruction mov r7, [r12] ;read flash status register (fsb) in r7 ;check if fsb.7 = data.7 xor r7, r13 jnb r7.7, prog_ok ;programming failed: flash remains in write ;operation. ;to go back to normal read operations, a read/reset ;command ;must be performed prog_error: mov r7, #0f0h ;load register r7 with read/reset command exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r7 ;address is dont care for read/reset command ... ;here place specific error handling code ... ... ;when programming operation finished succesfully, ;flash is set back automatically to normal read mode prog_ok: .... ....
st10f269 29/160 example 3 performing the block erase command we assume that in the initialization phase the lowest 32k bytes of flash memory (sector 0) have been mapped to segment 1.the registers r11/r12 contain an address related to the block to be erased (segment number in r11, segment offset in r12, for example r11 = 01h, r12= 4000h will erase the block 1 - first 8k byte block). mov r5, #01554h ;load auxilary register r5 with command address ;(used in command cycle 1) mov r6, #02aa8h ;load auxilary register r6 with command address ;(used in command cycle 2) sxct dppo, #08h ;push data page pointer 0 and load it to point ;to ;segment 2 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 1 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 2 mov r7, #080h ;load register r7 with block erase command mov [r5], r7 ;command cycle 3 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 4 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 5 pop dpp0 ;restore dpp0: following addressing to the flash ;will use extended instructions ;r11 contains the segment of the block to be erased ;r12 contains the segment offset address of the ;block to be erased mov r7, #030h ;load register r7 with erase confirm code exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r7 ;command cycle 6: the epc starts execution of ;erasing command erase_polling: exts r11, #1 ;use extended addressing for next mov instruction mov r7, [r12] ;read flash status register (fsb) in r7 ;check if fsb.7 = 1 (i.e. r7.7 = 1) jb r7.7, erase_ok ;check if fsb.5 = 1 (erasing error) jnb r7.5, erase_polling ;programming failed: flash remains in write ;operation. ;to go back to normal read operations, a read/reset ;command ;must be performed erase_error: mov r7, #0f0h ;load register r7 with read/reset command exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r7 ;address is dont care for read/reset command ... ;here place specific error handling code ... ... ;when erasing operation finished succesfully, ;flash is set back automatically to normal read mode erase_ok: .... ....
st10f269 30/160 5.6 - bootstrap loader the built-in bootstrap loader (bsl) of the st10f269 provides a mechanism to load the startup program through the serial interface after reset. in this case, no external memory or internal flash memory is required for the initialization code starting at location 000000h (see figure 5). the bootstrap loader moves code/data into the internal ram, but can also transfer data via the serial interface into an external ram using a second level loader routine. flash memory (internal or external) is not necessary, but it may be used to provide lookup tables or core-code like a set of general purpose subroutines for i/o operations, number crunching, system initialization, etc. the bootstrap loader can be used to load the complete application software into romless systems, to load temporary software into complete systems for testing or calibration, or to load a programming routine for flash devices. the bsl mechanism can be used for standard system startup as well as for special occasions like system maintenance (firmer update) or end-of-line programming or testing. 5.6.1 - entering the bootstrap loader the st10f269 enters bsl mode when pin p0l.4 is sampled low at the end of a hardware reset. in this case the built-in bootstrap loader is activated independent of the selected bus mode. the bootstrap loader code is stored in a special boot-rom. no part of the standard mask memory or flash memory area is required for this. after entering bsl mode and the respective initialization the st10f269 scans the rxd0 line to receive a zero byte, one start bit, eight 0 data bits and one stop bit. from the duration of this zero byte it calculates the corresponding baud rate factor with respect to the current cpu clock, initializes the serial interface asc0 accordingly and switches pin txd0 to output. using this baud rate, an identification byte is returned to the host that provides the loaded data. this identification byte identifies the device to be booted. the identification byte is d5h for st10f269. figure 5 : bootstrap loader sequence rstin txd0 internal boot memory (bsl) routine 32 byte user software 2) 3) rxd0 csp:ip 4) 6) p0l.4 1) bsl initialization time 2) zero byte (1 start bit, eight 0 data bits, 1 stop bit), sent by host. 3) identification byte (d5h), sent by st10f269. 4) 32 bytes of code / data, sent by host. 5) caution: txd0 is only driven a certain time after reception of the zero byte. 6) internal boot rom. 1) 5)
st10f269 31/160 when the st10f269 has entered bsl mode, the following configuration is automatically set (values that deviate from the normal reset values, are marked ): in this case, the watchdog timer is disabled, so the bootstrap loading sequence is not time limited. pin txd0 is configured as output, so the st10f269 can return the identification byte. even if the internal flash is enabled, no code can be executed out of it. the hardware that activates the bsl during reset may be a simple pull-down resistor on p0l.4 for systems that use this feature upon every hardware reset. a switchable solution (via jumper or an external signal) can be used for systems that only temporarily use the bootstrap loader (see figure 6). after sending the identification byte the asc0 receiver is enabled and is ready to receive the initial 32 bytes from the host. a half duplex connection is therefore sufficient to feed the bsl. 5.6.2 - memory configuration after reset the configuration (and the accessibility) of the st10f269s memory areas after reset in bootstrap-loader mode differs from the standard case. pin ea is not evaluated when bsl mode is selected, and accesses to the internal flash area are partly redirected, while the st10f269 is in bsl mode (see figure 7). all code fetches are made from the special boot-rom, while data accesses read from the internal user flash. data accesses will return undefined values on romless devices. the code in the boot-rom is not an invariant feature of the st10f269. user software should not try to execute code from the internal flash area while the bsl mode is still active, as these fetches will be redirected to the boot-rom. the boot-rom will also move to segment 1, when the internal flash area is mapped to segment 1 (see figure 7). watchdog timer: disabled register syscon: 0e00h context pointer cp: fa00h register stkun: fa40h stack pointer sp: fa40h register stkov: fa0ch 0<->c register s0con: 8011h register buscon0: acc. to startup configuration register s0bg: acc. to 00 byte p3.10 / txd0: 1 dp3.10: 1 figure 6 : hardware provisions to activate the bsl r pol.4 8k w circuit 1 pol.4 pol.4 normal boot bsl external signal r pol.4 8k w circuit 2
st10f269 32/160 figure 7 : memory configuration after reset 5.6.3 - loading the startup code after sending the identification byte the bsl enters a loop to receive 32 bytes via asc0. these byte are stored sequentially into locations 00fa40h through 00fa5fh of the internal ram. so up to 16 instructions may be placed into the ram area. to execute the loaded code the bsl then jumps to location 00fa40h, which is the first loaded instruction. the bootstrap loading sequence is now terminated, the st10f269 remains in bsl mode, however. most probably the initially loaded routine will load additional code or data, as an average application is likely to require substantially more than 16 instructions. this second receive loop may directly use the pre-initialized interface asc0 to receive data and store it to arbitrary user-defined locations. this second level of loaded code may be the final application code. it may also be another, more sophisticated, loader routine that adds a transmission protocol to enhance the integrity of the loaded code or data. it may also contain a code sequence to change the system configuration and enable the bus interface to store the received data into external memory. this process may go through several iterations or may directly execute the final application. in all cases the st10f269 will still run in bsl mode, that means with the watchdog timer disabled and limited access to the internal flash area. all code fetches from the internal flash area (000000h...007fffh or 010000h...017fffh, if mapped to segment 1) are redirected to the special boot-rom. data fetches access will access the internal boot-rom of the st10f269, if any is available, but will return undefined data on romless devices. 5.6.4 - exiting bootstrap loader mode in order to execute a program in normal mode, the bsl mode must be terminated first. the st10f269 exits bsl mode upon a software reset (ignores the level on p0l.4) or a hardware reset (p0l.4 must be high). after a reset the st10f269 will start executing from location 000000h of the internal flash or the external memory, as programmed via pin ea . 16m bytes 16m bytes 16m bytes bsl mode active yes (p0l.4=0) yes (p0l.4=0) no (p0l.4=1) ea pin high low access to application code fetch from internal flash area test-flash access test-flash access user flash access data fetch from internal flash area user flash access user flash access user flash access iram 1 0 user flash test flash segment 2 255 access to: external bus disabled internal enabled flash 1 0 user flash test flash segment 2 255 access to: external bus enabled internal enabled flash iram 1 0 user flash segment 2 255 access: depends on reset config ea , port0 depends on reset config ea , port0 iram
st10f269 33/160 5.6.5 - choosing the baud rate for the bsl the calculation of the serial baud rate for asc0 from the length of the first zero byte that is received, allows the operation of the bootstrap loader of the st10f269 with a wide range of baud rates. however, the upper and lower limits have to be kept, in order to insure proper data transfer. the st10f269 uses timer t6 to measure the length of the initial zero byte. the quantization uncertainty of this measurement implies the first deviation from the real baud rate, the next deviation is implied by the computation of the s0brl reload value from the timer contents. the formula below shows the association: for a correct data transfer from the host to the st10f269 the maximum deviation between the internal initialized baud rate for asc0 and the real baud rate of the host should be below 2.5%. the deviation (f b , in percent) between host baud rate and st10f269 baud rate can be calculated via the formula below: note: function (f b ) does not consider the tolerances of oscillators and other devices supporting the serial communication. this baud rate deviation is a nonlinear function depending on the cpu clock and the baud rate of the host. the maxima of the function (f b ) increase with the host baud rate due to the smaller baud rate pre-scaler factors and the implied higher quantization error (see figure 8). the minimum baud rate (b low in the figure 8) is determined by the maximum count capacity of timer t6, when measuring the zero byte, and it depends on the cpu clock. using the maximum t6 count 2 16 in the formula the minimum baud rate can be calculated. the lowest standard baud rate in this case would be 1200 baud. baud rates below b low would cause t6 to overflow. in this case asc0 cannot be initialized properly. the maximum baud rate (b high in the figure 8) is the highest baud rate where the deviation still does not exceed the limit, so all baud rates between b low and b high are below the deviation limit. the maximum standard baud rate that fulfills this requirement is 19200 baud. higher baud rates , however, may be used as long as the actual deviation does not exceed the limit. a certain baud rate (marked i in figure 8) may violate the deviation limit, while an even higher baud rate (marked ii in figure 8) stays very well below it. this depends on the host interface. f cpu 32 s0brl 1 + () ----------------------------------------------- - b st10f269 = s0brl t6 36 C 72 ------------------- - = t6 9 4 -- - f cpu b host ----------------- = , f b b contr b host C b contr -------------------------------------------- 100 = % , f b 2.5 % figure 8 : baud rate deviation between host and st10f269 b low 2.5% f b b high i ii b host
st10f269 34/160 6 - central processing unit (cpu) the cpu includes a 4-stage instruction pipeline, a 16-bit arithmetic and logic unit (alu) and dedi- cated sfrs. additional hardware has been added for a separate multiply and divide unit, a bit-mask generator and a barrel shifter. most of the st10f269s instructions can be exe- cuted in one instruction cycle which requires 50ns at 40mhz cpu clock. for example, shift and rotate instructions are processed in one instruc- tion cycle independent of the number of bits to be shifted. multiple-cycle instructions have been optimized: branches are carried out in 2 cycles, 16 x 16-bit multiplication in 5 cycles and a 32/16-bit division in 10 cycles. the jump cache reduces the execution time of repeatedly performed jumps in a loop, from 2 cycles to 1 cycle. the cpu uses a bank of 16 word registers to run the current context. this bank of general purpose registers (gpr) is physically stored within the on-chip internal ram (iram) area. a context pointer (cp) register determines the base address of the active register bank to be accessed by the cpu. the number of register banks is only restricted by the available internal ram space. for easy parameter passing, a register bank may overlap others. a system stack of up to 1024 bytes is provided as a storage for temporary data. the system stack is allocated in the on-chip ram area, and it is accessed by the cpu via the stack pointer (sp) register. two separate sfrs, stkov and stkun, are implicitly compared against the stack pointer value upon each stack access for the detection of a stack overflow or underflow. figure 9 : cpu block diagram (mac unit not included) 32 internal ram 2k byte general purpose registers r0 r15 mdh mdl barrel-shift mul./div.-hw bit-mask gen. alu 16-bit cp sp stkov stkun exec. unit instr. ptr 4-stage pipeline psw syscon buscon 0 buscon 1 buscon 2 buscon 3 buscon 4 addrsel 1 addrsel 2 addrsel 3 addrsel 4 data pg. ptrs code seg. ptr. cpu 256k byte flash memory 16 16 bank n bank i bank 0
st10f269 35/160 the system configuration register syscon this bit-addressable register provides general system configuration and control functions. the reset value for register syscon depends on the state of the port0 pins during reset. syscon (ff12h / 89h) sfr reset value: 0xx0h notes: 1. these bits are set directly or indirectly according to port0 and ea pin configuration during reset sequence. 2. register syscon cannot be changed after execution of the einit instruction. 6.1 - multiplier-accumulator unit (mac) the mac co-processor is a specialized co-pro- cessor added to the st10 cpu core in order to improve the performances of the st10 family in signal processing algorithms. signal processing needs at least three specialized units operating in parallel to achieve maximum performance : C a multiply-accumulate unit, C an address generation unit, able to feed the mac unit with 2 operands per cycle, C a repeat unit, to execute series of multiply-ac- cumulate instructions. the existing st10 cpu has been modified to include new addressing capabilities which enable the cpu to supply the new co-processor with up to 2 operands per instruction cycle. this new co-processor (so-called mac) contains a fast multiply-accumulate unit and a repeat unit. the co-processor instructions extend the st10 cpu instruction set with multiply, multiply-accu- mulate, 32-bit signed arithmetic operations. a new transfer instruction comov has also been added to take benefit of the new addressing capa- bilities. 1514131211109876543210 stksz rom s1 sgt dis rom en byt dis clk en wr cfg cs cfg pwd cfg owd dis bdr sten xpen visi ble xper- share rw rw rw rw 1 rw 1 rw rw 1 rw rw rw rw rw rw rw bit function xpen 0 1 xbus peripheral enable bit accesses to the on-chip x-peripherals and their functions are disabled the on-chip x-peripherals are enabled and can be accessed. bdrsten 0 1 bidirectional reset enable rstin pin is an input pin only. sw reset or wdt reset have no effect on this pin rstin pin is a bidirectional pin. this pin is pulled low during 1024 tcl during reset sequence. owddis 0 1 oscillator watchdog disable control oscillator watchdog (owd) is enabled. if pll is bypassed, the owd monitors xtal1 activity. if there is no activity on xtal1 for at least 1 m s, the cpu clock is switched automatically to plls base frequency (2 to 10mhz). owd is disabled. if the pll is bypassed, the cpu clock is always driven by xtal1 signal. the pll is turned off to reduce power supply current.. pwdcfg 0 1 power down mode configuration control power down mode can only be entered during pwrdn instruction execution if nmi pin is low, oth- erwise the instruction has no effect. to exit power down mode, an external reset must occurs by asserting the rstin pin. power down mode can only be entered during pwrdn instruction execution if all enabled fast external interrupt exxin pins are in their inactive level. exiting this mode can be done by asserting one enabled exxin pin. cscfg 0 1 chip select configuration control latched chip select lines: csx change 1 tcl after rising edge of ale unlatched chip slect lines : csx change with rising edge of ale
st10f269 36/160 6.1.1 - features 6.1.1.1 - enhanced addressing capabilities C new addressing modes including a double indi- rect addressing mode with pointer post-modifi- cation. C parallel data move : this mechanism allows one operand move during multiply-accumulate in- structions without penalty. C new tranfer instructions costore (for fast ac- cess to the mac sfrs) and comov (for fast memory to memory table transfer). 6.1.1.2 - multiply-accumulate unit C one-cycle execution for all mac operations. C 16 x 16-bit signed/unsigned parallel multiplier. C 40-bit signed arithmetic unit with automatic sat- uration mode. C 40-bit accumulator. C 8-bit left/right shifter. C full instruction set with multiply and multiply-ac- cumulate, 32-bit signed arithmetic and compare instructions. 6.1.1.3 - program control C repeat unit : allows some mac co-processor in- structions to be repeated up to 8192 times. re- peated instructions may be interrupted. C mac interrupt (class b trap) on mac condition flags. figure 10 : mac unit architecture note: * shared with standard alu. operand 2 operand 1 control unit repeat unit st10 cpu interrupt controller msw mrw mah mal mcw flags mae mux 8-bit left/right shifter mux mux sign extend 16 x 16 concatenation signed/unsigned multiplier 40-bit signed arithmetic unit 0h 0h 08000h 40 16 40 40 32 32 16 40 40 40 40 40 scaler ab 40 gpr pointers * idx0 pointer idx1 pointer qr0 gpr offset register qr1 gpr offset register qx0 idx offset register qx1 idx offset register
st10f269 37/160 6.2 - instruction set summary the table 4 lists the instructions of the st10f269. the various addressing modes, instruction operation, parameters for conditional execution of instructions, opcodes and a detailed description of each instruc- tion can be found in the st10 family programming manual. table 4 : instruction set summary mnemonic description bytes add(b) add word (byte) operands 2 / 4 addc(b) add word (byte) operands with carry 2 / 4 sub(b) subtract word (byte) operands 2 / 4 subc(b) subtract word (byte) operands with carry 2 / 4 mul(u) (un)signed multiply direct gpr by direct gpr (16-16-bit) 2 div(u) (un)signed divide register mdl by direct gpr (16-/16-bit) 2 divl(u) (un)signed long divide reg. md by direct gpr (32-/16-bit) 2 cpl(b) complement direct word (byte) gpr 2 neg(b) negate direct word (byte) gpr 2 and(b) bit-wise and, (word/byte operands) 2 / 4 or(b) bit-wise or, (word/byte operands) 2 / 4 xor(b) bit-wise xor, (word/byte operands) 2 / 4 bclr clear direct bit 2 bset set direct bit 2 bmov(n) move (negated) direct bit to direct bit 4 band, bor, bxor and/or/xor direct bit with direct bit 4 bcmp compare direct bit to direct bit 4 bfldh/l bit-wise modify masked high/low byte of bit-addressable direct word memory with immediate data 4 cmp(b) compare word (byte) operands 2 / 4 cmpd1/2 compare word data to gpr and decrement gpr by 1/2 2 / 4 cmpi1/2 compare word data to gpr and increment gpr by 1/2 2 / 4 prior determine number of shift cycles to normalize direct word gpr and store result in direct word gpr 2 shl / shr shift left/right direct word gpr 2 rol / ror rotate left/right direct word gpr 2 ashr arithmetic (sign bit) shift right direct word gpr 2 mov(b) move word (byte) data 2 / 4 movbs move byte operand to word operand with sign extension 2 / 4 movbz move byte operand to word operand with zero extension 2 / 4 jmpa, jmpi, jmpr jump absolute/indirect/relative if condition is met 4 jmps jump absolute to a code segment 4 j(n)b jump relative if direct bit is (not) set 4 jbc jump relative and clear bit if direct bit is set 4
st10f269 38/160 6.3 - mac coprocessor specific instructions the following table gives an overview of the mac instruction set. all the mnemonics are listed with the addressing modes that can be used with each instruction. for each combination of mnemonic and address- ing mode this table indicates if it is repeatable or not. new addressing capabilities enable the cpu to supply the mac with up to 2 operands per instruc- tion cycle. mac instructions: multiply, multi- ply-accumulate, 32-bit signed arithmetic operations and the comov transfer instruction have been added to the standard instruction set. full details are provided in the st10 family programming manual. double indirect addressing requires two pointers. any gpr can be used for one pointer, the other pointer is provided by one of two specific sfrs idx0 and idx1. two pairs of offset registers qr0/qr1 and qx0/qx1 are associated with each pointer (gpr or idx i ). the gpr pointer allows access to the entire memory space, but idx i are limited to the internal dual-port ram, except for the comov instruction. jnbs jump relative and set bit if direct bit is not set 4 calla, calli, callr call absolute/indirect/relative subroutine if condition is met 4 calls call absolute subroutine in any code segment 4 pcall push direct word register onto system stack and call absolute subroutine 4 trap call interrupt service routine via immediate trap number 2 push, pop push/pop direct word register onto/from system stack 2 scxt push direct word register onto system stack and update register with word operand 4 ret return from intra-segment subroutine 2 rets return from inter-segment subroutine 2 retp return from intra-segment subroutine and pop direct word register from system stack 2 reti return from interrupt service subroutine 2 srst software reset 4 idle enter idle mode 4 pwrdn enter power down mode (supposes nmi -pin being low) 4 srvwdt service watchdog timer 4 diswdt disable watchdog timer 4 einit signify end-of-initialization on rstout-pin 4 atomic begin atomic sequence 2 extr begin extended register sequence 2 extp(r) begin extended page (and register) sequence 2 / 4 exts(r) begin extended segment (and register) sequence 2 / 4 nop null operation 2 table 4 : instruction set summary mnemonic description bytes
st10f269 39/160 mnemonic addressing modes repeatability comul rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no no no comulu comulus comulsu comul- comulu- comulus- comulsu- comul, rnd comulu, rnd comulus, rnd comulsu, rnd comac rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no ye s ye s comacu comacus comacsu comac- comacu- comacus- comacsu- comac, rnd comacu, rnd comacus, rnd comacsu, rnd comacr comacru comacrus rw n , rw m [idx i ? ], [rw n ? ] rw n , [rw m ? ] no no no comacrsu comacr, rnd comacru, rnd comacrus, rnd comacrsu, rnd conop [rw m ?] ye s [idx i ? ] ye s [idx i ? ], [rw m ?] ye s coneg -no coneg, rnd cornd costore rw n , coreg no [rw n ?] , coreg ye s comov [idx i ? ], [rw m ?] ye s
st10f269 40/160 comacm [idx i ? ], [rw m ?] ye s comacmu comacmus comacmsu comacm- comacmu- comacmus- comacmsu- comacm, rnd comacmu, rnd comacmus, rnd comacmsu, rnd comacmr comacmru comacmrus comacmrsu comacmr, rnd comacmru, rnd comacmrus, rnd comacmrsu, rnd coadd rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no ye s ye s coadd2 cosub cosub2 cosubr cosub2r comax comin coload rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] coload- no coload2 no coload2- no cocmp coshl rw m #data4 [rw m ?] ye s no ye s coshr coashr coashr, rnd coabs - rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no no no mnemonic addressing modes repeatability
st10f269 41/160 the table 5 shows the various combinations of pointer post-modification for each of these 2 new addressing modes. in this document the symbols [rw n ? ] and [idx i ? ] refer to these addressing modes. table 5 : pointer post-modification combinations for idxi and rwn symbol mnemonic address pointer operation [idx i ? ] stands for [idx i ] (idx i ) ? (idx i ) (no-op) [idx i + ] (idx i ) ? (idx i ) + 2 (i=0,1) [idx i -] (idx i ) ? (idx i ) - 2 (i=0,1) [idx i + qx j ] (idx i ) ? (idx i ) + (qx j ) (i, j =0,1) [idx i - qx j ] (idx i ) ? (idx i ) - (qx j ) (i, j =0,1) [rw n ? ] stands for [rwn] (rwn) ? (rwn) (no-op) [rwn + ] (rwn) ? (rwn) + 2 (n=0-15) [rwn-] (rwn) ? (rwn) - 2 (n=0-15) [rwn + qr j ] (rwn) ? (rwn) + (qr j ) (n=0-15; j =0,1) [rwn - qr j ] (rwn) ? (rwn) - (qr j ) (n=0-15; j =0,1) table 6 : mac registers referenced as coreg registers description address in opcode msw mac-unit status word 00000b mah mac-unit accumulator high 00001b mas limited mah /signed 00010b mal mac-unit accumulator low 00100b mcw mac-unit control word 00101b mrw mac-unit repeat word 00110b
st10f269 42/160 7 - external bus controller all of the external memory accesses are performed by the on-chip external bus controller. the ebc can be programmed to single chip mode when no external memory is required, or to one of four different external memory access modes: C 16- / 18- / 20- / 24-bit addresses and 16-bit data, demultiplexed C 16- / 18- / 20- / 24-bit addresses and 16-bit data, multiplexed C 16- / 18- / 20- / 24-bit addresses and 8-bit data, multiplexed C 16- / 18- / 20- / 24-bit addresses and 8-bit data, demultiplexed in demultiplexed bus modes addresses are output on port1 and data is input / output on port0 or p0l, respectively. in the multiplexed bus modes both addresses and data use port0 for input / output. timing characteristics of the external bus interface (memory cycle time, memory tri-state time, length of ale and read / write delay) are programmable giving the choice of a wide range of memories and external peripherals. up to 4 independent address windows may be defined (using register pairs addrselx / busconx) to access different resources and bus characteristics. these address windows are arranged hierarchically where buscon4 overrides buscon3 and buscon2 overrides buscon1. all accesses to locations not covered by these 4 address windows are controlled by buscon0. up to 5 external cs signals (4 windows plus default) can be generated in order to save external glue logic. access to very slow memories is supported by a ready function. a hold / hlda protocol is available for bus arbitration which shares external resources with other bus masters. the bus arbitration is enabled by setting bit hlden in register psw. after setting hlden once, pins p6.7...p6.5 (breq , hlda , hold ) are automatically controlled by the ebc. in master mode (default after reset) the hlda pin is an output. by setting bit dp6.7 to1 the slave mode is selected where pin hlda is switched to input. this directly connects the slave controller to another master controller without glue logic. for applications which require less external memory space, the address space can be restricted to 1m byte, 256k bytes or to 64k bytes. port 4 outputs all 8 address lines if an address space of 16m bytes is used, otherwise four, two or no address lines. chip select timing can be made programmable. by default (after reset), the csx lines change half a cpu clock cycle after the rising edge of ale. with the cscfg bit set in the syscon register the csx lines change with the rising edge of ale. the active level of the ready pin can be set by bit rdypol in the busconx registers. when the ready function is enabled for a specific address window, each bus cycle within the window must be terminated with the active level defined by bit rdypol in the associated buscon register. 7.1 - programmable chip select timing control the st10f269 allows the user to adjust the position of the csx line changes. by default (after reset), the csx lines change half a cpu clock cycle (12.5ns at 40mhz of cpu clock) after the rising edge of ale. with the cscfg bit set in the syscon register the csx lines c hange with the rising edge of ale, thus the csx lines and the address lines change at the same time (see figure 11). 7.2 - ready programmable polarity the active level of the ready pin can be selected by software via the rdypol bit in the busconx registers. when the ready function is enabled for a specific address window, each bus cycle within this window must be terminated with the active level defined by this rdypol bit in the associated buscon register. busconx registers are described in section 20.2 - system configuration registers. note st10f269 as no internal pull-up resistor on ready pin.
st10f269 43/160 figure 11 : chip select delay normal csx rd address (p1) ale segment (p4) normal demultiplexed bus cycle ale lengthen demultiplexed bus cycle unlatched csx wr read/write delay data data data data bus (p0) bus (p0) read/write delay
st10f269 44/160 8 - interrupt system the interrupt response time for internal program execution is from 125ns to 300ns at 40mhz cpu clock. the st10f269 architecture supports several mechanisms for fast and flexible response to service requests that can be generated from various sources (internal or external) to the microcontroller. any of these interrupt requests can be serviced by the interrupt controller or by the peripheral event controller (pec). in contrast to a standard interrupt service where the current program execution is suspended and a branch to the interrupt vector table is performed, just one cycle is stolen from the current cpu activity to perform a pec service. a pec service implies a single byte or word data transfer between any two memory locations with an additional increment of either the pec source or destination pointer. an individual pec transfer counter is implicitly decremented for each pec service except when performing in the continuous transfer mode. when this counter reaches zero, a standard interrupt is performed to the corresponding source related vector location. pec services are very well suited to perform the transmission or the reception of blocks of data. the st10f269 has 8 pec channels, each of them offers such fast interrupt-driven data transfer capabilities. an interrupt control register which contains an interrupt request flag, an interrupt enable flag and an interrupt priority bit-field is dedicated to each existing interrupt source. thanks to its related register, each source can be programmed to one of sixteen interrupt priority levels. once starting to be processed by the cpu, an interrupt service can only be interrupted by a higher prioritized service request. for the standard interrupt processing, each of the possible interrupt sources has a dedicated vector location. software interrupts are supported by means of the trap instruction in combination with an individual trap (interrupt) number. 8.1 - external interrupts fast external interrupt inputs are provided to service external interrupts with high precision requirements. these fast interrupt inputs feature programmable edge detection (rising edge, falling edge or both edges). fast external interrupts may also have interrupt sources selected from other peripherals; for example the canx controller receive signal (canx_rxd) can be used to interrupt the system. this new function is controlled using the external interrupt source selection register exisel. exisel (f1dah / edh) esfr reset value: 0000h 1514131211109876543210 exi7ss exi6ss exi5ss exi4ss exi3ss exi2ss exi1ss exi0ss rw rw rw rw rw rw rw rw exixss external interrupt x source selection (x=7...0) 00: input from associated port 2 pin. 01: input from alternate source. 10: input from port 2 pin ored with alternate source. 11: input from port 2 pin anded with alternate source. exixss port 2 pin alternate source 0 p2.8 can1_rxd 1 p2.9 can2_rxd 2 p2.10 rtcsi (timed) 3 p2.11 rtcai (alarm) 4...7 p2.12...15 not used (zero)
st10f269 45/160 8.2 - interrupt registers and vectors location list table 7 shows all the available st10f269 interrupt sources and the corresponding hardware-related interrupt flags, vectors, vector locations and trap (interrupt) numbers: table 7 : interrupt sources source of interrupt or pec service request request flag enable flag interrupt vector vector location trap number capcom register 0 cc0ir cc0ie cc0int 000040h 10h capcom register 1 cc1ir cc1ie cc1int 000044h 11h capcom register 2 cc2ir cc2ie cc2int 000048h 12h capcom register 3 cc3ir cc3ie cc3int 00004ch 13h capcom register 4 cc4ir cc4ie cc4int 000050h 14h capcom register 5 cc5ir cc5ie cc5int 000054h 15h capcom register 6 cc6ir cc6ie cc6int 000058h 16h capcom register 7 cc7ir cc7ie cc7int 00005ch 17h capcom register 8 cc8ir cc8ie cc8int 000060h 18h capcom register 9 cc9ir cc9ie cc9int 000064h 19h capcom register 10 cc10ir cc10ie cc10int 000068h 1ah capcom register 11 cc11ir cc11ie cc11int 00006ch 1bh capcom register 12 cc12ir cc12ie cc12int 000070h 1ch capcom register 13 cc13ir cc13ie cc13int 000074h 1dh capcom register 14 cc14ir cc14ie cc14int 000078h 1eh capcom register 15 cc15ir cc15ie cc15int 00007ch 1fh capcom register 16 cc16ir cc16ie cc16int 0000c0h 30h capcom register 17 cc17ir cc17ie cc17int 0000c4h 31h capcom register 18 cc18ir cc18ie cc18int 0000c8h 32h capcom register 19 cc19ir cc19ie cc19int 0000cch 33h capcom register 20 cc20ir cc20ie cc20int 0000d0h 34h capcom register 21 cc21ir cc21ie cc21int 0000d4h 35h capcom register 22 cc22ir cc22ie cc22int 0000d8h 36h capcom register 23 cc23ir cc23ie cc23int 0000dch 37h capcom register 24 cc24ir cc24ie cc24int 0000e0h 38h capcom register 25 cc25ir cc25ie cc25int 0000e4h 39h capcom register 26 cc26ir cc26ie cc26int 0000e8h 3ah capcom register 27 cc27ir cc27ie cc27int 0000ech 3bh capcom register 28 cc28ir cc28ie cc28int 0000f0h 3ch capcom register 29 cc29ir cc29ie cc29int 000110h 44h capcom register 30 cc30ir cc30ie cc30int 000114h 45h capcom register 31 cc31ir cc31ie cc31int 000118h 46h capcom timer 0 t0ir t0ie t0int 000080h 20h
st10f269 46/160 hardware traps are exceptions or error conditions that arise during run-time. they cause immediate non-maskable system reaction similar to a standard interrupt service (branching to a dedicated vector table location). the occurrence of a hardware trap is additionally signified by an individual bit in the trap flag register (tfr). except when another higher prioritized trap service is in progress, a hardware trap will interrupt any other program execution. hardware trap services cannot not be interrupted by standard interrupt or by pec interrupts. 8.3 - interrupt control registers all interrupt control registers are identically organized. the lower 8 bits of an interrupt control register contain the complete interrupt status information of the associated source, which is required during one round of prioritization, the upper 8 bits of the respective register are reserved. all interrupt control registers are bit-addressable and all bits can be read or written via software. this allows each interrupt source to be programmed or modified with just one instruction. when accessing interrupt control registers through instructions which operate on word data types, their upper 8 bits (15...8) will return zeros, when read, and will discard written data. the layout of the interrupt control registers shown below applies to each xxic register, where xx stands for the mnemonic for the respective source. capcom timer 1 t1ir t1ie t1int 000084h 21h capcom timer 7 t7ir t7ie t7int 0000f4h 3dh capcom timer 8 t8ir t8ie t8int 0000f8h 3eh gpt1 timer 2 t2ir t2ie t2int 000088h 22h gpt1 timer 3 t3ir t3ie t3int 00008ch 23h gpt1 timer 4 t4ir t4ie t4int 000090h 24h gpt2 timer 5 t5ir t5ie t5int 000094h 25h gpt2 timer 6 t6ir t6ie t6int 000098h 26h gpt2 caprel register crir crie crint 00009ch 27h a/d conversion complete adcir adcie adcint 0000a0h 28h a/d overrun error adeir adeie adeint 0000a4h 29h asc0 transmit s0tir s0tie s0tint 0000a8h 2ah asc0 transmit buffer s0tbir s0tbie s0tbint 00011ch 47h asc0 receive s0rir s0rie s0rint 0000ach 2bh asc0 error s0eir s0eie s0eint 0000b0h 2ch ssc transmit sctir sctie sctint 0000b4h 2dh ssc receive scrir scrie scrint 0000b8h 2eh ssc error sceir sceie sceint 0000bch 2fh pwm channel 0...3 pwmir pwmie pwmint 0000fch 3fh can1 interface xp0ir xp0ie xp0int 000100h 40h can2 interface xp1ir xp1ie xp1int 000104h 41h flash ready / busy xp2ir xp2ie xp2int 000108h 42h pll unlock/owd xp3ir xp3ie xp3int 00010ch 43h table 7 : interrupt sources (continued) source of interrupt or pec service request request flag enable flag interrupt vector vector location trap number
st10f269 47/160 xxic (yyyyh / zzh) sfr area reset value: - - 00h 8.4 - exception and error traps list table 8 shows all of the possible exceptions or error conditions that can arise during run-time : * - all the class b traps have the same trap number (and vector) and the same lower priority compare to the class a traps and t o the resets. - each class a traps has a dedicated trap number (and vector). they are prioritized in the second priority level. - the resets have the highest priority level and the same trap number. - the psw.ilvl cpu priority is forced to the highest level (15) when these exeptions are serviced. 1514131211109876543210 -------- xxir xxie ilvl glvl rw rw rw rw bit function glvl group level defines the internal order for simultaneous requests of the same priority. 3: highest group priority 0: lowest group priority ilvl interrupt priority level defines the priority level for the arbitration of requests. fh: highest priority level 0h: lowest priority level xxie interrupt enable control bit (individually enables/disables a specific source) 0: interrupt request is disabled 1: interrupt request is enabled xxir interrupt request flag 0: no request pending 1: this source has raised an interrupt request table 8 : trap priorities exception condition trap flag trap vector vector location trap number trap* priority reset functions: hardware reset software reset watchdog timer overflow reset reset reset 000000h 000000h 000000h 00h 00h 00h iii iii iii class a hardware traps: non-maskable interrupt stack overflow stack underflow nmi stkof stkuf nmitrap stotrap stutrap 000008h 000010h 000018h 02h 04h 06h ii ii ii class b hardware traps: undefined opcode protected instruction fault illegal word operand access illegal instruction access illegal external bus access undopc prtflt illopa illina illbus btrap btrap btrap btrap btrap 000028h 000028h 000028h 000028h 000028h 0ah 0ah 0ah 0ah 0ah i i i i i reserved [002ch - 003ch] [0bh - 0fh] software traps trap instruction any 0000h C 01fch in steps of 4h any [00h - 7fh] current cpu priority
st10f269 48/160 9 - capture/compare (capcom) units the st10f269 has two 16 channels capcom units as described in figure 12. these support generation and control of timing sequences on up to 32 channels with a maximum resolution of 200ns at 40mhz cpu clock. the capcom units are typically used to handle high speed i/o tasks such as pulse and waveform generation, pulse width modulation (pmw), digital to analog (d/a) conversion, software timing, or time recording relative to external events. four 16-bit timers (t0/t1, t7/t8) with reload registers provide two independent time bases for the capture/compare register array (see figures 13 and 14). the input clock for the timers is programmable to several prescaled values of the internal system clock, or may be derived from an overflow/ underflow of timer t6 in module gpt2. this provides a wide range of variation for the timer period and resolution and allows precise adjustments to application specific requirements. in addition, external count inputs for capcom timers t0 and t7 allow event scheduling for the capture/compare registers relative to external events. each of the two capture/compare register arrays contain 16 dual purpose capture/compare registers, each of which may be individually allocated to either capcom timer t0 or t1 (t7 or t8, respectively), and programmed for capture or compare functions. each of the 32 registers has one associated port pin which serves as an input pin for triggering the capture function, or as an output pin to indicate the occurrence of a compare event. figure 12 shows the basic structure of the two capcom units. * the capcom2 unit provides 16 capture inputs, but only 12 compare outputs. cc24i to cc27i are inputs only. figure 12 : capcom unit block diagram pin tx input control 2 n n = 3...10 gpt2 timer t6 pin txin cpu clock mode control (capture or compare) 16 capture inputs compare outputs pin ty input control 2 n n = 3...10 gpt2 timer t6 over / underflow cpu clock reload register txrel capcom timer tx interrupt request sixteen 16-bit (capture/compare) registers over / underflow capcom timer ty reload register tyrel 16 capture / compare* interrupt requests interrupt request x = 0, 7 y = 1, 8
st10f269 49/160 figure 13 : block diagram of capcom timers t0 and t7 figure 14 : block diagram of capcom timers t1 and t8 note: when an external input signal is connected to the input lines of both t0 and t7, these timers count the input signal synchronously. thus the two timers can be regarded as one timer whose contents can be compared with 32 capture registers. when a capture/compare register has been selected for capture mode, the current contents of the allocated timer will be latched (captured) into the capture/compare register in response to an external event at the port pin which is associated with this register. in addition, a specific interrupt request for this capture/compare register is generated. either a positive, a negative, or both a positive and a negative external signal transition at the pin can be selected as the triggering event. the contents of all registers which have been selected for one of the five compare modes are continuously compared with the contents of the allocated timers. when a match occurs between the timer value and the value in a capture /compare register, specific actions will be taken based on the selected compare mode (see table 9). the input frequencies f tx , for the timer input selector tx, are determined as a function of the cpu clocks. the timer input frequencies, resolution and periods which result from the selected pre-scaler option in txi when using a 40mhz cpu clock are listed in the table 10. the numbers for the timer periods are based on a reload value of 0000h. note that some numbers may be rounded to 3 significant figures. pin x txl cpu clock txr mux gpt2 timer t6 over / underflow edge select txin txl txl txm input control reload register txrel capcom timer tx txir interrupt request x = 0, 7 x txl cpu clock txr mux gpt2 timer t6 over / underflow txm reload register txrel capcom timer tx txir interrupt request x = 1, 8
st10f269 50/160 table 9 : compare modes compare modes function mode 0 interrupt-only compare mode; several compare interrupts per timer period are possible mode 1 pin toggles on each compare match; several compare events per timer period are possible mode 2 interrupt-only compare mode; only one compare interrupt per timer period is generated mode 3 pin set 1 on match; pin reset 0 on compare time overflow; only one compare event per timer period is generated double register mode two registers operate on one pin; pin toggles on each compare match; several compare events per timer period are possible. table 10 : capcom timer input frequencies, resolution and periods f cpu = 40mhz timer input selection txi 000b 001b 010b 011b 100b 101b 110b 111b pre-scaler for f cpu 8 16 32 64 128 256 512 1024 input frequency 5mhz 2.5mhz 1.25mhz 625khz 312.5khz 156.25khz 78.125khz 39.1khz resolution 200ns 400ns 0.8s 1.6s 3.2s 6.4s 12.8s 25.6s period 13.1ms 26.2ms 52.4ms 104.8ms 209.7ms 419.4ms 838.9ms 1.678s
st10f269 51/160 10 - general purpose timer unit the gpt unit is a flexible multifunctional timer/ counter structure which is used for time related tasks such as event timing and counting, pulse width and duty cycle measurements, pulse generation, or pulse multiplication. the gpt unit contains five 16-bit timers organized into two separate modules gpt1 and gpt2. each timer in each module may operate independently in several different modes, or may be concatenated with another timer of the same module. 10.1 - gpt1 each of the three timers t2, t3, t4 of the gpt1 module can be configured individually for one of four basic modes of operation: timer , gated timer , counter mode and incremental interface mode . in timer mode, the input clock for a timer is derived from the cpu clock, divided by a programmable prescaler. in counter mode, the timer is clocked in reference to external events. pulse width or duty cycle measurement is supported in gated timer mode where the operation of a timer is controlled by the gate level on an external input pin. for these purposes, each timer has one associated port pin (txin) which serves as gate or clock input. table 11 lists the timer input frequencies, resolution and periods for each pre-scaler option at 40mhz cpu clock. this also applies to the gated timer mode of t3 and to the auxiliary timers t2 and t4 in timer and gated timer mode. the count direction (up/down) for each timer is programmable by software or may be altered dynamically by an external signal on a port pin (txeud). in incremental interface mode, the gpt1 timers (t2, t3, t4) can be directly connected to the incremental position sensor signals a and b by their respective inputs txin and txeud. direction and count signals are internally derived from these two input signals so that the contents of the respective timer tx corresponds to the sensor position. the third position sensor signal top0 can be connected to an interrupt input. timer t3 has output toggle latches (txotl) which changes state on each timer over flow / underflow. the state of this latch may be output on port pins (txout) for time out monitoring of external hardware components, or may be used internally to clock timers t2 and t4 for high resolution of long duration measurements. in addition to their basic operating modes, timers t2 and t4 may be configured as reload or capture registers for timer t3. when used as capture or reload registers, timers t2 and t4 are stopped. the contents of timer t3 is captured into t2 or t4 in response to a signal at their associated input pins (txin). timer t3 is reloaded with the contents of t2 or t4 triggered either by an external signal or by a selectable state transition of its toggle latch t3otl. when both t2 and t4 are configured to alternately reload t3 on opposite state transitions of t3otl with the low and high times of a pwm signal, this signal can be constantly generated without software intervention. table 11 : gpt1 timer input frequencies, resolution and periods f cpu = 40mhz timer input selection t2i / t3i / t4i 000b 001b 010b 011b 100b 101b 110b 111b pre-scaler factor 8 16 32 64 128 256 512 1024 input freq 5mhz 2.5mhz 1.25mhz 625khz 312.5khz 156.25khz 78.125khz 39.1khz resolution 200ns 400ns 0.8s 1.6s 3.2s 6.4s 12.8s 25.6s period maximum 13.1ms 26.2ms 52.4ms 104.8ms 209.7ms 419.4ms 838.9ms 1.678s
st10f269 52/160 figure 15 : block diagram of gpt1 10.2 - gpt2 the gpt2 module provides precise event control and time measurement. it includes two timers (t5, t6) and a capture/reload register (caprel). both timers can be clocked with an input clock which is derived from the cpu clock via a programmable prescaler or with external signals. the count direction (up/down) for each timer is programmable by software or may additionally be altered dynamically by an external signal on a port pin (txeud). concatenation of the timers is supported via the output toggle latch (t6otl) of timer t6 which changes its state on each timer overflow/underflow. the state of this latch may be used to clock timer t5, or it may be output on a port pin (t6out). the overflow / underflow of timer t6 can additionally be used to clock the capcom timers t0 or t1, and to cause a reload from the caprel register. the caprel register may capture the contents of timer t5 based on an external signal transition on the corresponding port pin (capin), and timer t5 may optionally be cleared after the capture procedure. this allows absolute time differences to be measured or pulse multiplication to be performed without software overhead. the capture trigger (timer t5 to caprel) may also be generated upon transitions of gpt1 timer t3 inputs t3in and/or t3eud. this is advantageous when t3 operates in incremental interface mode. table 12 lists the timer input frequencies, resolution and periods for each pre-scaler option at 40mhz cpu clock. this also applies to the gated timer mode of t6 and to the auxiliary timer t5 in timer and gated timer mode. 2 n n=3...10 2 n n=3...10 2 n n=3...10 t2eud t2in cpu clock cpu clock cpu clock t3in t4in t3eud t4eud t2 mode control t3 mode control t4 mode control gpt1 timer t2 gpt1 timer t3 gpt1 timer t4 t3otl reload capture u/d u/d reload capture interrupt request interrupt request interrupt request t3out u/d table 12 : gpt2 timer input frequencies, resolution and period f cpu = 40mhz timer input selection t5i / t6i 000b 001b 010b 011b 100b 101b 110b 111b pre-scaler factor 4 8 16 32 64 128 256 512 input freq 10mhz 5mhz 2.5mhz 1.25mhz 625khz 312.5khz 156.25khz 78.125khz resolution 100ns 200ns 400ns 0.8s 1.6s 3.2s 6.4s 12.8s period maximum 6.55ms 13.1ms 26.2ms 52.4ms 104.8ms 209.7ms 419.4ms 838.9ms
st10f269 53/160 figure 16 : block diagram of gpt2 2 n n=2...9 2 n n=2...9 t5eud t5in cpu clock cpu clock t6in t6eud t5 mode control t6 mode control gpt2 timer t5 gpt2 timer t6 u/d interrupt request u/d gpt2 caprel t60tl toggle ff t6out capin reload interrupt request to capcom timers capture clear interrupt request
st10f269 54/160 11 - pwm module the pulse width modulation module can generate up to four pwm output signals using edge-aligned or centre-aligned pwm. in addition, the pwm module can generate pwm burst signals and single shot outputs. the table 13 shows the pwm frequencies for different resolutions. the level of the output signals is selectable and the pwm module can generate interrupt requests. figure 17 : block diagram of pwm module table 13 : pwm unit frequencies and resolution at 40mhz cpu clock mode 0 resolution 8-bit 10-bit 12-bit 14-bit 16-bit cpu clock/1 25ns 156.25khz 39.1khz 9.77khz 2.44hz 610hz cpu clock/64 1.6 m s 2.44hz 610hz 152.6hz 38.15hz 9.54hz mode 1 resolution 8-bit 10-bit 12-bit 14-bit 16-bit cpu clock/1 25ns 78.12khz 19.53khz 4.88khz 1.22khz 305.17hz cpu clock/64 1.6 m s 1.22khz 305.17hz 76.29hz 19.07hz 4.77hz ppx period register comparator ptx 16-bit up/down counter shadow register pwx pulse width register input run control clock 1 clock 2 comparator * * * up/down/ clear control match output control match write control * user readable / writeable register enable poutx
st10f269 55/160 12 - parallel ports 12.1 - introduction the st10f269 mcu provides up to 111 i/o lines with programmable features. these capabilities bring very flexible adaptation of this mcu to wide range of applications. st10f269 has 9 groups of i/o lines gathered as following: C port 0 is a 2 time 8-bit port named p0l (low as less significant byte) and p0h (high as most sig- nificant byte) C port 1 is a 2 time 8-bit port named p1l and p1h C port 2 is a 16-bit port C port 3 is a 15-bit port (p3.14 line is not imple- mented) C port 4 is a 8-bit port C port 5 is a 16-bit port input only C port 6, port 7 and port 8 are 8-bit port these ports may be used as general purpose bidirectionnal input or output, software controlled with dedicated registers. for example the output drivers of six of the ports (2, 3, 4, 6, 7, 8) can be configured (bit-wise) for push-pull or open drain operation using odpx registers. in addition, the sink and the source capability and the rise / fall time of the transition of the signal of some of the push-pull buffers can be programmed to fit the driving requirements of the application and to minimize emi. this feature is implemented on port 0, 1, 2, 3, 4, 6, 7 and 8 with the control registers poconx. the output drivers capabilities of ale, rd , wr control lines are programmable with the dedicated bits of pocon20 control register. the input threshold levels are programmable (ttl/cmos) for 5 ports (2, 3, 4, 7, 8). the logic level of a pin is clocked into the input latch once per state time, regardless whether the port is configured for input or output. the threshold is selected with the picon register control bits. a write operation to a port pin configured as an input causes the value to be written into the port output latch, while a read operation returns the latched state of the pin itself. a read-modify-write operation reads the value of the pin, modifies it, and writes it back to the output latch. writing to a pin configured as an output (dpx.y=1) causes the output latch and the pin to have the written value, since the output buffer is enabled. reading this pin returns the value of the output latch. a read-modify-write operation reads the value of the output latch, modifies it, and writes it back to the output latch, thus also modifying the level at the pin. i/o lines support an alternate function which is detailed in the following description of each port.
st10f269 56/160 figure 18 : sfrs and pins associated with the parallel ports data input / output register 15 - 14 - 13 - 12 - 11 - 10 - 9 - 8 - 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y p0l ---- - - - - yyyyyyyy p0h ---- - - - - yyyyyyyy p1l ---- - - - - yyyyyyyy p1h yyyy y y yyyyyyyyyy p2 y-yy y y yyyyyyyyyy p3 ---- - - - - yyyyyyyy p4 yyyy y y yyyyyyyyyy p5 ---- - - - - yyyyyyyy p6 ---- - - - - yyyyyyyy p7 ---- - - - - yyyyyyyy p8 direction control registers 15 - 14 - 13 - 12 - 11 - 10 - 9 - 8 - 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y dp0l ---- - - - - yyyyyyyy dp0h ---- - - - - yyyyyyyy dp1l ---- - - - - yyyyyyyy dp1h yyyy y y yyyyyyyyyy dp2 y-yy y y yyyyyyyyyy dp3 ---- - - - - yyyyyyyy dp4 ---- - - - - yyyyyyyy dp6 ---- - - - - yyyyyyyy dp7 ---- - - - - yyyyyyyy dp8 threshold / open drain control 15 - 14 - 13 - 12 - 11 - 10 - 9 - 8 - 7 y 6 y 5 - 4 y 3 y 2 y 1 y 0 y picon yyyy y yyyyyyyyyyy odp2 --y- y yyyyyyyyyyy odp3 ---- - - --yy------ odp4 ---- - - - - yyyyyyyy odp6 ---- - - - - yyyyyyyy odp7 ---- - - - - yyyyyyyy odp8 output driver control register 15 - 14 - 13 - 12 - 11 - 10 - 9 - 8 - 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y pocon0l ---- - - - - yyyyyyyy pocon0h ---- - - - - yyyyyyyy pocon1l ---- - - - - yyyyyyyy pocon1h yyyy y y yyyyyyyyyy pocon2 y-yy y y yyyyyyyyyy pocon3 ---- - - - - yyyyyyyy pocon4 ---- - - - - yyyyyyyy pocon6 ---- - - - - yyyyyyyy pocon7 ---- - - - - yyyyyyyy pocon8 ---- - - - - yyyyyyyy pocon20 * * rd , wr , ale lines only y : bit has an i/o function - : bit has no i/o dedicated function or is not implemented register belongs to esfr area e: yyyy y yyyyyyyyyyy p5didis picon: p2lin p2hin p3lin p3hin p4lin p6lin (to be implemented) p7lin p8lin e e e e e e e e e e e e e e e e e e e e e e
st10f269 57/160 12.2 - i/os special features 12.2.1 - open drain mode some of the i/o ports of st10f269 support the open drain capability. this programmable feature may be used with an external pull-up resistor, in order to get an and wired logical function. this feature is implemented for ports p2, p3, p4, p6, p7 and p8 (see respective sections), and is controlled through the respective open drain control registers odpx. these registers allow the individual bit-wise selection of the open drain mode for each port line. if the respective control bit odpx.y is 0 (default after reset), the output driver is in the push-pull mode. if odpx.y is 1, the open drain configuration is selected. note that all odpx registers are located in the esfr space (see figure 19). 12.2.2 - input threshold control the standard inputs of the st10f269 determine the status of input signals according to ttl levels. in order to accept and recognize noisy signals, cmos-like input thresholds can be selected instead of the standard ttl thresholds for all pins of port 2, port 3, port 4, port 7 and port 8. these special thresholds are defined above the ttl thresholds and feature a defined hysteresis to prevent the inputs from toggling while the respective input signal level is near the thresholds. the port input control register picon is used to select these thresholds for each byte of the indicated ports, this means the 8-bit ports p4, p7 and p8 are controlled by one bit each while ports p2 and p3 are controlled by two bits each. all options for individual direction and output mode control are available for each pin, independent of the selected input threshold. the input hysteresis provides stable inputs from noisy or slowly changing external signals (see figure 20). picon (f1c4h / e2h) e s f r r e s e t v a l u e : - - 0 0 h 1514131211109876543210 --------p8linp7lin-p4linp3hinp3linp2hinp2lin rw rw rw rw rw rw rw bit function pxlin port x low byte input level selection 0: pins px.7...px.0 switch on standard ttl input levels 1: pins px.7...px.0 switch on special threshold input levels pxhin port x high byte input level selection 0: pins px.15...px.8 switch on standard ttl input levels 1: pins px.15...px.8 switch on special threshold input levels figure 19 : output drivers in push-pull mode and in open drain mode pin q push-pull output driver q open drain output driver external pullup pin
st10f269 58/160 12.2.3 - output driver control the port output control registers poconx allow to select the port output driver characteristics of a port. the aim of these selections is to adapt the output drivers to the applications requirements, and to improve the emi behaviour of the device. two characteristics may be selected: edge characteristic defines the rise/fall time for the respective output. slow edges reduce the peak currents that are sinked/sourced when changing the voltage level of an external capacitive load. for a bus interface or pins that are changing at frequency higher than 1mhz, however, fast edges may still be required. driver characteristic defines either the general driving capability of the respective driver, or if the driver strength is reduced after the target output level has been reached or not. reducing the driver strength increases the outputs internal resistance, which attenuates noise that is imported via the output line. for driving leds or power transistors, however, a stable high output current may still be required as described below. this rise / fall time of 4 i/o pads (a nibble) is selected using 2-bit named pnxec . that means p ort n ibble ( x = nibble number, it could be 3 as for port 2.15 to 2.12) e dge c haracteristic. the sink / source capability of the same 4 i/o pads is selected using 2-bit named pnxdc . that means p ort n ibble ( x = nibble number) d rive c haracteristic (see table 14). poconx (f0yyh / zzh) for 8-bit ports esfr reset value: --00h poconx (f0yyh / zzh) for 16-bit ports esfr reset value: 0000h note: in case of reading an 8 bit p0conx register, high byte ( bit 15..8) is read as 00h figure 20 : hysteresis for special input thresholds input level bit state hysteresis 1514131211109876543210 -------- pn1dc pn1ec pn0dc pn0ec rw rw rw rw 1514131211109876543210 pn3dc pn3ec pn2dc pn2ec pn1dc pn1ec pn0dc pn0ec rw rw rw rw rw rw rw rw bit function pnxec port nibble x edge characteristic (rise/fall time) 00: fast edge mode, rise/fall times depend on the size of the driver. 01: slow edge mode, rise/fall times ~60 ns 10: reserved 11: reserved pnxdc port nibble x driver characteristic (output current) 00: high current mode: driver always operates with maximum strength. 01: dynamic current mode: driver strength is reduced after the target level has been reached. 10: low current mode: driver always operates with reduced strength. 11: reserved
st10f269 59/160 the table lists the defined pocon registers and the allocation of control bit-fields and port pins. dedicated pins output control programmable pad drivers also are supported for the dedicated pins ale, rd and wr . for these pads, a special pocon20 register is provided. pocon20 (f0aah / 55h) esfr reset value: --00h table 14 : port control register allocation control register physical address 8-bit address controlled port nibble 3 210 pocon0l f080h 40h p0l.7...4 p0l.3...0 pocon0h f082h 41h p0h.7...4 p0h.3...0 pocon1l f084h 42h p1l.7...4 p1l.3...0 pocon1h f086h 43h p1h.7...4 p1h.3...0 pocon2 f088h 44h p2.15...12 p2.11...8 p2.7...4 p2.3...0 pocon3 f08ah 45h p3.15, 3.13, 3.12 p3.11...8 p3.7...4 p3.3...0 pocon4 f08ch 46h p4.7...4 p4.3...0 pocon6 f08eh 47h p6.7...4 p6.3...0 pocon7 f090h 48h p7.7...4 p7.3...0 pocon8 f092h 49h p8.7...4 p8.3...0 1514131211109876543210 -------- pn1dc pn1ec pn0dc pn0ec rw rw rw rw pn0ec rd , wr edge characteristic (rise/fall time) 00: fast edge mode, rise/fall times depend on the size of the driver. 01: slow edge mode, rise/fall times ~60 ns 10: reserved 11: reserved pn0dc rd , wr driver characteristic (output current) 00: high current mode: driver always operates with maximum strength. 01: dynamic current mode: driver strength is reduced after the target level has been reached. 10: low current mode: driver always operates with reduced strength. 11: reserved pn1ec ale edge characteristic (rise/fall time) 00: fast edge mode, rise/fall times depend on the size of the driver. 01: slow edge mode, rise/fall times ~60 ns 10: reserved 11: reserved pn1dc ale driver characteristic (output current) 00: high current mode: driver always operates with maximum strength. 01: dynamic current mode: driver strength is reduced after the target level has been reached. 10: low current mode: driver always operates with reduced strength. 11: reserved
st10f269 60/160 12.2.4 - alternate port functions each port line has one associated programmable alternate input or output function. C port0 and port1 may be used as address and data lines when accessing external memory. C port 2, port 7 and port 8 are associated with the capture inputs or compare outputs of the cap- com units and/or with the outputs of the pwm module. port 2 is also used for fast external interrupt in- puts and for timer 7 input. C port 3 includes the alternate functions of timers, serial interfaces, the optional bus control signal bhe and the system clock output (clkout). C port 4 outputs the additional segment address bit a16 to a23 in systems where segmentation is enabled to access more than 64k bytes of memory. C port 5 is used as analog input channels of the a/d converter or as timer control signals. C port 6 provides optional bus arbitration signals (breq , hlda , hold ) and chip select signals. if an alternate output function of a pin is to be used, the direction of this pin must be programmed for output (dpx.y=1), except for some signals that are used directly after reset and are configured automatically. otherwise the pin remains in the high-impedance state and is not effected by the alternate output function. the respective port latch should hold a 1, because its output is anded with the alternate output data (except for pwm output signals). if an alternate input function of a pin is used, the direction of the pin must be programmed for input (dpx.y=0) if an external device is driving the pin. the input direction is the default after reset. if no external device is connected to the pin, however, one can also set the direction for this pin to output. in this case, the pin reflects the state of the port output latch. thus, the alternate input function reads the value stored in the port output latch. this can be used for testing purposes to allow a software trigger of an alternate input function by writing to the port output latch. on most of the port lines, the application software must set the proper direction when using an alternate input or output function of a pin. this is done by setting or clearing the direction control bit dpx.y of the pin before enabling the alternate function. there are port lines, however, where the direction of the port line is switched automatically. for instance, in the multiplexed external bus modes of port0, the direction must be switched several times for an instruction fetch in order to output the addresses and to input the data. obviously, this cannot be done through instructions. in these cases, the direction of the port line is switched automatically by hardware if the alternate function of such a pin is enabled. to determine the appropriate level of the port output latches check how the alternate data output is combined with the respective port latch output. there is one basic structure for all port lines supporting only one alternate input function. port lines with only one alternate output function, however, have different structures. it has to be adapted to support the normal and the alternate function features. all port lines that are not used for these alternate functions may be used as general purpose i/o lines. when using port pins for general purpose output, the initial output value should be written to the port latch prior to enabling the output drivers, in order to avoid undesired transitions on the output pins. this applies to single pins as well as to pin groups (see examples below). single_bit: bset p4.7 ; initial output level is "high" bset dp4.7 ; switch on the output driver bit_group: bfldh p4, #24h, #24h ; initial output level is "high" bfldh dp4, #24h, #24h ; switch on the output drivers note: when using several bset pairs to control more pins of one port, these pairs must be separated by instructions, which do not apply to the respective port (see chapter 6 - central processing unit (cpu)).
st10f269 61/160 12.3 - port0 the two 8-bit ports p0h and p0l represent the higher and lower part of port0, respectively. both halves of port0 can be written (via a pec transfer) without effecting the other half. if this port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction registers dp0h and dp0l. p0l (ff00h / 80h) sfr reset value: --00h p0h (ff02h / 81h) sfr reset value: --00h dp0l (f100h / 80h) esfr reset value: --00h dp0h (f102h / 81h) esfr reset value: --00h 1514131211109876543210 --------p0l.7p0l.6p0l.5p0l.4p0l.3p0l.2p0l.1p0l.0 rw rw rw rw rw rw rw rw 1514131211109876543210 --------p0h.7p0h.6p0h.5p0h.4p0h.3p0h.2p0h.1p0h.0 rw rw rw rw rw rw rw rw p0x.y port data register p0h or p0l bit y 1514131211109876543210 --------dp0l.7dp0l.6dp0l.5dp0l.4dp0l.3dp0l.2dp0l.1dp0l.0 rw rw rw rw rw rw rw rw 1514131211109876543210 --------dp0h.7dp0h.6dp0h.5dp0h.4dp0h.3dp0h.2dp0h.1dp0h.0 rw rw rw rw rw rw rw rw dp0x.y port direction register dp0h or dp0l bit y dp0x.y = 0: port line p0x.y is an input (high-impedance) dp0x.y = 1: port line p0x.y is an output
st10f269 62/160 12.3.1 - alternate functions of port0 when an external bus is enabled, port0 is used as data bus or address/data bus. note that an external 8-bit demultiplexed bus only uses p0l, while p0h is free for i/o (provided that no other bus mode is enabled). port0 is also used to select the system start-up configuration. during reset, port0 is configured to input, and each line is held high through an internal pull-up device. each line can now be individually pulled to a low level (see section 21.3 - dc characteristics) through an external pull-down device. a default configuration is selected when the respective port0 lines are at a high level. through pulling individual lines to a low level, this default can be changed according to the needs of the applications. the internal pull-up devices are designed in such way that an external pull-down resistors (see data sheet specification) can be used to apply a correct low level. these external pull-down resistors can remain connected to the port0 pins also during normal operation, however, care has to be taken in order to not disturb the normal function of port0 (this might be the case, for example, if the external resistor value is too low). with the end of reset, the selected bus configuration will be written to the buscon0 register. the configuration of the high byte of port0, will be copied into the special register rp0h. this read-only register holds the selection for the number of chip selects and segment addresses. software can read this register in order to react according to the selected configuration, if required. when the reset is terminated, the internal pull-up devices are switched off, and port0 will be switched to the appropriate operating mode. during external accesses in multiplexed bus modes port0 first outputs the 16-bit intra-segment address as an alternate output function. port0 is then switched to high-impedance input mode to read the incoming instruction or data. in 8-bit data bus mode, two memory cycles are required for word accesses, the first for the low byte and the second for the high byte of the word. during write cycles port0 outputs the data byte or word after outputting the address. during external accesses in demultiplexed bus modes port0 reads the incoming instruction or data word or outputs the data byte or word. figure 21 : port0 i/o and alternate functions p0h.7 p0h.6 p0h.5 p0h.4 p0h.3 p0h.2 p0h.1 p0h.0 p0l.7 p0l.6 p0l.5 p0l.4 p0l.3 p0l.2 p0l.1 p0l.0 port0 p0h p0l alternate function a) b) c) d) general purpose input/output 8-bit demultiplexed bus 16-bit demultiplexed bus 8-bit multiplexed bus 16-bit multiplexed bus d7 d6 d5 d4 d3 d2 d1 d0 d15 d14 d13 d12 d11 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 a15 a14 a13 a12 a11 a10 a9 a8 ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 ad15 ad14 ad13 ad12 ad11 ad10 ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0
st10f269 63/160 when an external bus mode is enabled, the direction of the port pin and the loading of data into the port output latch are controlled by the bus controller hardware. the input of the port output buffer is disconnected from the internal bus and is switched to the line labeled alternate data output via a multiplexer. the alternate data can be the 16-bit intra-segment address or the 8/16-bit data information. the incoming data on port0 is read on the line alternate data input. while an external bus mode is enabled, the user software should not write to the port output latch, otherwise unpredictable results may occur. when the external bus modes are disabled, the contents of the direction register last written by the user becomes active. the figure 22 shows the structure of a port0 pin. figure 22 : block diagram of a port0 pin direction latch write dp0h.y / dp0l.y read dp0h.y / dp0l.y port output latch write p0h.y / p0l.y read p0h.y / p0l.y internal bus mux 0 1 mux 0 1 alternate data output mux 0 1 alternate direction input latch clock p0h.y p0l.y output buffer y = 7...0 alternate function enable port data output
st10f269 64/160 12.4 - port1 the two 8-bit ports p1h and p1l represent the higher and lower part of port1, respectively. both halves of port1 can be written (via a pec transfer) without effecting the other half. if this port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction registers dp1h and dp1l. p1l (ff04h / 82h) sfr reset value: --00h p1h (ff06h / 83h) sfr reset value: --00h dp1l (f104h / 82h) esfr reset value: --00h dp1h (f106h / 83h) esfr reset value: --00h 12.4.1 - alternate functions of port1 when a demultiplexed external bus is enabled, port1 is used as address bus. note: demultiplexed bus modes use port1 as a 16-bit port. otherwise all 16 port lines can be used for general purpose i/o. the upper 4 pins of port1 (p1h.7...p1h.4) are used as capture input lines (cc27io...cc24io). during external accesses in demultiplexed bus modes port1 outputs the 16-bit intra-segment address as an alternate output function. during external accesses in multiplexed bus modes, when no buscon register selects a demultiplexed bus mode, port1 is not used and is available for general purpose i/o. 1514131211109876543210 --------p1l.7p1l.6p1l.5p1l4p1l.3p1l.2p1l.1p1l.0 rw rw rw rw rw rw rw rw 1514131211109876543210 --------p1h.7p1h.6p1h.5p1h.4p1h.3p1h.2p1h.1p1h.0 rw rw rw rw rw rw rw rw p1x.y port data register p1h or p1l bit y 1514131211109876543210 - - - - - - - - dp1l.7 dp1l.6 dp1l.5 dp1l.4 dp1l.3 dp1l.2 dp1l.1 dp1l.0 rw rw rw rw rw rw rw rw 1514131211109876543210 - - - - - - - - dp1h.7 dp1h.6 dp1h.5 dp1h.4 dp1h.3 dp1h.2 dp1h.1 dp1h.0 rw rw rw rw rw rw rw rw dp1x.y port direction register dp1h or dp1l bit y dp1x.y = 0: port line p1x.y is an input (high-impedance) dp1x.y = 1: port line p1x.y is an output
st10f269 65/160 figure 23 : port1 i/o and alternate functions when an external bus mode is enabled, the direction of the port pin and the loading of data into the port output latch are controlled by the bus controller hardware. the input of the port buffer latch is disconnected from the internal bus and is switched to the line labeled alternate data output via a multiplexer. the alternate data is the 16-bit intra-segment address. while an external bus mode is enabled, the user software should not write to the port output latch, otherwise unpredictable results may occur. when the external bus modes are disabled, the contents of the direction register last written by the user becomes active. the figure 24 shows the structure of a port1 pin. port1 p1h p1l alternate function a) general purpose input/output 8/16-bit demultiplexed bus b) capcom2 capture inputs only p1h.7 p1h.6 p1h.5 p1h.4 p1h.3 p1h.2 p1h.1 p1h.0 p1l.7 p1l.6 p1l.5 p1l.4 p1l.3 p1l.2 p1l.1 p1l.0 a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 cc27io cc26io cc25io cc24io figure 24 : block diagram of a port1 pin direction latch write dp1h.y / dp1l.y read dp1h.y / dp1l.y port output latch write p1h.y / p1l.y read p1h.y / p1l.y internal bus mux 0 1 mux 0 1 mux 0 1 1 input latch clock p1h.y p1l.y output buffer y = 7...0 alternate function enable port data output alternate data output
st10f269 66/160 12.5 - port 2 if this 16-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp2. each port line can be switched into push/pull or open drain mode via the open drain control register odp2. p2 (ffc0h / e0h) sfr reset value: 0000h dp2 (ffc2h / e1h) sfr reset value: 0000h odp2 (f1c2h / e1h) esfr reset value: 0000h 12.5.1 - alternate functions of port 2 all port 2 lines (p2.15...p2.0) serve as capture inputs or compare outputs (cc15io...cc0io) for the capcom1 unit. when a port 2 line is used as a capture input, the state of the input latch, which represents the state of the port pin, is directed to the capcom unit via the line alternate pin data input. if an external capture trigger signal is used, the direction of the respective pin must be set to input. if the direction is set to output, the state of the port output latch will be read since the pin represents the state of the output latch. this can be used to trigger a capture event through software by setting or clearing the port latch. note that in the output configuration, no external device may drive the pin, otherwise conflicts would occur. when a port 2 line is used as a compare output (compare modes 1 and 3), the compare event (or the timer overflow in compare mode 3) directly effects the port output latch. in compare mode 1, when a valid compare match occurs, the state of the port output latch is read by the capcom control hardware via the line alternate latch data input, inverted, and written back to the latch via the line alternate data output. the port output latch is clocked by the signal compare trigger which is generated by the capcom unit. in compare mode 3, when a match occurs, the value '1' is written to the port output latch via the line alternate data output. when an overflow of the corresponding timer occurs, a '0' is written to the port output latch. in both cases, the output latch is clocked by the signal compare trigger. 1514131211109876543210 p2.15 p2.14 p2.13 p2.12 p2.11 p2.10 p2.9 p2.8 p2.7 p2.6 p2.5 p2.4 p2.3 p2.2 p2.1 p2.0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw p2.y port data register p2 bit y 1514131211109876543210 dp2 .15 dp2 .14 dp2 .13 dp2 .12 dp2 .11 dp2 .10 dp2 .9 dp2 .8 dp2 .7 dp2 .6 dp2 .5 dp2 .4 dp2 .3 dp2 .2 dp2 .1 dp2 .0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw dp2.y port direction register dp2 bit y dp2.y = 0: port line p2.y is an input (high-impedance) dp2.y = 1: port line p2.y is an output 1514131211109876543210 odp2 .15 odp2 .14 odp2 .13 odp2 .12 odp2 .11 odp2 .10 odp2 .9 odp2 .8 odp2 .7 odp2 .6 odp2 .5 odp2 .4 odp2 .3 odp2 .2 odp2 .1 odp2 .0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw odp2.y port 2 open drain control register bit y odp2.y = 0: port line p2.y output driver in push/pull mode odp2.y = 1: port line p2.y output driver in open drain mode
st10f269 67/160 the direction of the pin should be set to output by the user, otherwise the pin will be in the high-impedance state and will not reflect the state of the output latch. as can be seen from the port structure in figure 26, the user software always has free access to the port pin even when it is used as a compare output. this is useful for setting up the initial level of the pin when using compare mode 1 or the double-register mode. in these modes, unlike in compare mode 3, the pin is not set to a specific value when a compare match occurs, but is toggled instead. when the user wants to write to the port pin at the same time a compare trigger tries to clock the output latch, the write operation of the user software has priority. each time a cpu write access to the port output latch occurs, the input multiplexer of the port output latch is switched to the line connected to the internal bus. the port output latch will receive the value from the internal bus and the hardware triggered change will be lost. as all other capture inputs, the capture input function of pins p2.15...p2.0 can also be used as external interrupt inputs (200ns sample rate at 40mhz cpu clock). the upper eight port 2 lines (p2.15...p2.8) also can serve as fast external interrupt inputs from ex0in to ex7in (fast external interrupt sampling rate is 25ns at 40mhz cpu clock). p2.15 in addition serves as input for capcom2 timer t7 (t7in). the table 15 summarizes the alternate functions of port 2. table 15 : alternate functions of port 2 port 2 pin alternate function a) alternate function b) alternate function c) p2.0 p2.1 p2.2 p2.3 p2.4 p2.5 p2.6 p2.7 p2.8 p2.9 p2.10 p2.11 p2.12 p2.13 p2.14 p2.15 cc0io cc1io cc2io cc3io cc4io cc5io cc6io cc7io cc8io cc9io cc10io cc11io cc12io cc13io cc14io cc15io - - - - - - - - ex0in fast external interrupt 0 input ex1in fast external interrupt 1 input ex2in fast external interrupt 2 input ex3in fast external interrupt 3 input ex4in fast external interrupt 4 input ex5in fast external interrupt 5 input ex6in fast external interrupt 6 input ex7in fast external interrupt 7 input - - - - - - - - - - - - - - - t7in t7 external count input figure 25 : port 2 i/o and alternate functions port 2 alternate function a) general purpose input / output capcom1 capture input / compare output b) fast external interrupt input c) capcom2 timer t7 input p2.15 p2.14 p2.13 p2.12 p2.11 p2.10 p2.9 p2.8 p2.7 p2.6 p2.5 p2.4 p2.3 p2.2 p2.1 p2.0 cc15io cc14io cc13io cc12io cc11io cc10io cc9io cc8io cc7io cc6io cc5io cc4io cc3io cc2io cc1io cc0io ex7in ex6in ex5in ex4in ex3in ex2in ex1in ex0in t7in
st10f269 68/160 the pins of port 2 combine internal bus data with alternate data output before the port latch input. figure 26 : block diagram of a port 2 pin open drain latch write odp2.y read odp2.y direction latch write dp2.y read dp2.y internal bus mux 0 1 alternate data input input latch clock p2.y ccyio output buffer x = 7...0 alternate data output mux 0 1 output latch 3 1 write port p2.y compare trigger read p2.y fast external interrupt input exxin y = 15...0
st10f269 69/160 12.6 - port 3 if this 15-bit port is used for general purpose i/o, the direction of each line can be configured by the corresponding direction register dp3. most port lines can be switched into push-pull or open drain mode by the open drain control register odp2 (pins p3.15, p3.14 and p3.12 do not support open drain mode). due to pin limitations register bit p3.14 is not connected to an output pin. p3 (ffc4h / e2h) sfr reset value: 0000h dp3 (ffc6h / e3h) sfr reset value: 0000h odp3 (f1c6h / e3h) esfr reset value: 0000h 1514131211109876543210 p3.15 - p3.13 p3.12 p3.11 p3.10 p3.9 p3.8 p3.7 p3.6 p3.5 p3.4 p3.3 p3.2 p3.1 p3.0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw p3.y port data register p3 bit y 1514131211109876543210 dp3 .15 - dp3 .13 dp3 .12 dp3 .11 dp3 .10 dp3 .9 dp3 .8 dp3 .7 dp3 .6 dp3 .5 dp3 .4 dp3 .3 dp3 .2 dp3 .1 dp3 .0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw dp3.y port direction register dp3 bit y dp3.y = 0: port line p3.y is an input (high-impedance) dp3.y = 1: port line p3.y is an output 1514131211109876543210 - - odp3 .13 - odp3 .11 odp3 .10 odp3 .9 odp3 .8 odp3 .7 odp3 .6 odp3 .5 odp3 .4 odp3 .3 odp3 .2 odp3 .1 odp3 .0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw odp3.y port 3 open drain control register bit y odp3.y = 0: port line p3.y output driver in push-pull mode odp3.y = 1: port line p3.y output driver in open drain mode
st10f269 70/160 12.6.1 - alternate functions of port 3 the pins of port 3 serve for various functions which include external timer control lines, the two serial interfaces and the control lines bhe /wrh and clkout. the structure of the port 3 pins depends on their alternate function (see figures 28 and 29). when the on-chip peripheral associated with a port 3 pin is configured to use the alternate input function, it reads the input latch, which represents the state of the pin, via the line labeled alternate data input. port 3 pins with alternate input functions are: t0in, t2in, t3in, t4in, t3eud and capin. when the on-chip peripheral associated with a port 3 pin is configured to use the alternate output function, its alternate data output line is anded with the port output latch line. when using these alternate functions, the user must set the direction of the port line to output (dp3.y=1) and must set the port output latch (p3.y=1). otherwise the pin is in its high-impedance state (when configured as input) or the pin is stuck at '0' (when the port output latch is cleared). when the alternate output functions are not used, the alternate data output line is in its inactive state, which is a high level ('1'). table 16 : port 3 alternative functions port 3 pin alternate function p3.0 p3.1 p3.2 p3.3 p3.4 p3.5 p3.6 p3.7 p3.8 p3.9 p3.10 p3.11 p3.12 p3.13 p3.14 p3.15 t0in capcom1 timer 0 count input t6out timer 6 toggle output capin gpt2 capture input t3out timer 3 toggle output t3eud timer 3 external up/down input t4in timer 4 count input t3in timer 3 count input t2in timer 2 count input mrst ssc master receive / slave transmit mtsr ssc master transmit / slave receive txd0 asc0 transmit data output rxd0 asc0 receive data input (output in synchronous mode) bhe /wrh byte high enable / write high output sclk ssc shift clock input/output --- no pin assigned clkout system clock output figure 27 : port 3 i/o and alternate functions port 3 no pin alternate function a) b) general purpose input/output p3.15 p3.13 p3.12 p3.11 p3.10 p3.9 p3.8 p3.7 p3.6 p3.5 p3.4 p3.3 p3.2 p3.1 p3.0 clkout sclk bhe rxd0 txd0 mtsr mrst t2in t3in t4in t3eud t3out capin t6out t0in wrh
st10f269 71/160 port 3 pins with alternate output functions are: t6out, t3out, txd0, bhe and clkout. when the on-chip peripheral associated with a port 3 pin is configured to use both the alternate input and output function, the descriptions above apply to the respective current operating mode. the direction must be set accordingly. port 3 pins with alternate input/output functions are: mtsr, mrst, rxd0 and sclk. note: enabling the clkout function automati- cally enables the p3.15 output driver. set- ting bit dp3.15=1 is not required. figure 28 : block diagram of port 3 pin with alternate input or alternate output function open drain latch write odp3.y read odp3.y direction latch write dp3.y read dp3.y internal bus mux 0 1 alternate data input input latch clock p3.y output buffer y = 13, 11...0 port output latch read p3.y write dp3.y & alternate data output port data output
st10f269 72/160 pin p3.12 (bhe /wrh ) is another pin with an alternate output function, however, its structure is slightly different. after reset the bhe or wrh function must be used depending on the system start-up configuration. in either of these cases, there is no possibility to program any port latches before. thus, the appropriate alternate function is selected automatically. if bhe /wrh is not used in the system, this pin can be used for general purpose i/o by disabling the alternate function (bytdis = 1 / wrcfg=0). note: enabling the bhe or wrh function automatically enables the p3.12 output driver. setting bit dp3.12=1 is not required. during bus hold pin p3.12 is switched back to its standard function and is then controlled by dp3.12 and p3.12. keep dp3.12 = 0 in this case to ensure floating in hold mode. figure 29 : block diagram of pins p3.15 (clkout) and p3.12 (bhe /wrh ) direction latch write dp3.x read dp3.x port output latch write p3.x read p3.x internal bus mux 0 1 mux 0 1 alternate data output mux 0 1 1 input latch clock p3.12/bhe p3.15/clkout output buffer x = 15, 12 alternate function enable
st10f269 73/160 12.7 - port 4 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp4. p4 (ffc8h / e4h) sfr reset value: --00h dp4 (ffcah / e5h) sfr reset value: --00h for can configuration support (see section 15), port 4 has an open drain function, controlled with the odp4 register: odp4 (f1cah / e5h) esfr reset value: --00h note: only bit 6 and 7 are implemented, all other bit will be read as 0. 1514131211109876543210 - - - - - - - - p4.7 p4.6 p4.5 p4.4 p4.3 p4.2 p4.1 p4.0 rw rw rw rw rw rw rw rw p4.y port data register p4 bit y 1514131211109876543210 - - - - - - - - dp4.7 dp4.6 dp4.5 dp4.4 dp4.3 dp4.2 dp4.1 dp4.0 rw rw rw rw rw rw rw rw dp4.y port direction register dp4 bit y dp4.y = 0: port line p4.y is an input (high-impedance) dp4.y = 1: port line p4.y is an output 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 --------odp4.7odp4.6- - - - - - rw rw odp4.y port 4 open drain control register bit y odp4.y = 0: port line p4.y output driver in push/pull mode odp4.y = 1: port line p4.y output driver in open drain mode if p4.y is not a segment address line output
st10f269 74/160 12.7.1 - alternate functions of port 4 during external bus cycles that use segmentation (address space above 64k bytes) a number of port 4 pins may output the segment address lines. the number of pins that is used for segment address output determines the external address space which is directly accessible. the other pins of port 4 may be used for general purpose i/o. if segment address lines are selected, the alternate function of port 4 may be necessary to access external memory directly after reset. for this reason port 4 will be switched to this alternate function automatically. the number of segment address lines is selected via port0 during reset. the selected value can be read from bitfield salsel in register rp0h (read only) in order to check the configuration during run time. the can interfaces use 2 or 4 pins of port 4 to interface each can modules to an external can transceiver. in this case the number of possible segment address lines is reduced. the table 17 summarizes the alternate functions of port 4 depending on the number of selected segment address lines (coded via bitfield salsel) table 17 : port 4 alternate functions port 4 standard function salsel = 01 64k bytes alternate function salsel = 11 256k bytes alternate function salsel = 00 1m byte alternate function salsel = 10 16m bytes p4.0 p4.1 p4.2 p4.3 p4.4 p4.5 p4.6 p4.7 gpio gpio gpio gpio gpio/can2_rxd gpio/can1_rxd gpio/can1_txd gpio/can2_txd segment address a16 segment address a17 gpio gpio gpio/can2_rxd gpio/can1_rxd gpio/can1_txd gpio/can2_txd segment. address a16 segment address a17 segment address a18 segment address a19 gpio/can2_rxd gpio/can1_rxd gpio/can1_txd gpio/can2_txd segment address a16 segment address a17 segment address a18 segment address a19 segment address a20 segment address a21 segment address a22 segment address a23 figure 30 : port 4 i/o and alternate functions port 4 alternate function a) general purpose input / output b) segment address lines cans i/o and general purpose input / output p4.7 p4.6 p4.5 p4.4 p4.3 p4.2 p4.1 p4.0 a23 a22 a21 a20 a19 a18 a17 a16 can2_txd can1_txd can1_rxd can2_rxd - - - -
st10f269 75/160 figure 31 : block diagram of a port 4 pin direction latch write dp4.y read dp4.y port output latch write p4.y read p4.y internal bus mux 0 1 mux 0 1 alternate data output mux 0 1 1 input latch clock p4.y output buffer y = 7...0 alternate function enable
st10f269 76/160 figure 32 : block diagram of p4.4 and p4.5 pins direction latch write dp4.x read dp4.x port output latch write p4.x read p4.x internal bus mux 0 1 mux 0 1 alternate data output mux 0 1 1 input latch clock p4.x x = 5, 4 alternate function enable 0 1 0 mux mux 0 1 0 output buffer & 1 y = 1, 2 (can channel) z = 2, 1 a = 0, 1 b = 1, 0 cany.rxd xpercon.a xpercon.b (canyen) (canzen)
st10f269 77/160 figure 33 : block diagram of p4.6 and p4.7 pins 12.8 - port 5 this 16-bit input port can only read data. there is no output latch and no direction register. data written to p5 will be lost. p5 (ffa2h / d1h) sfr reset value: xxxxh 1514131211109876543210 p5.15 p5.14 p5.13 p5.12 p5.11 p5.10 p5.9 p5.8 p5.7 p5.6 p5.5 p5.4 p5.3 p5.2 p5.1 p5.0 rrrrrrrrrrrrrrrr p5.y port data register p5 bit y (read only) mux 0 1 "0" open drain latch write odp4.x read odp4.x direction latch write dp4.x read dp4.x internal bus mux 0 1 input latch clock p4.x output buffer port output latch read p4.x write p4.x alternate data output mux 0 1 mux 0 1 "1" mux alternate function enable mux 0 1 "1" mux mux 0 1 "0" mux 0 1 mux 1 cany.txd xpercon.a (canyen) xpercon.b (canzen) data output x = 6, 7 y = 1, 2 (can channel) z = 2, 1 a = 0, 1 b = 1, 0
st10f269 78/160 12.8.1 - alternate functions of port 5 each line of port 5 is also connected to one of the multiplexer of the analog/digital converter. all port lines (p5.15...p5.0) can accept analog signals (an15...an0) to be converted by the adc. no special programming is required for pins that shall be used as analog inputs. some pins of port 5 also serve as external timer control lines for gpt1 and gpt2. the table 18 summarizes the alternate functions of port 5. table 18 : port 5 alternate functions port 5 pin alternate function a) alternate function b) p5.0 p5.1 p5.2 p5.3 p5.4 p5.5 p5.6 p5.7 p5.8 p5.9 p5.10 p5.11 p5.12 p5.13 p5.14 p5.15 analog input an0 analog input an1 analog input an2 analog input an3 analog input an4 analog input an5 analog input an6 analog input an7 analog input an8 analog input an9 analog input an10 analog input an11 analog input an12 analog input an13 analog input an14 analog input an15 - - - - - - - - - - t6eud timer 6 external up/down input t5eud timer 5 external up/down input t6in timer 6 count input t5in timer 5 count input t4eud timer 4 external up/down input t2eud timer 2 external up/down input figure 34 : port 5 i/o and alternate functions port 5 alternate function a) general purpose inputs b) a/d converter inputs timer inputs p5.7 p5.6 p5.5 p5.4 p5.3 p5.2 p5.1 p5.0 p5.15 p5.14 p5.13 p5.12 p5.11 p5.10 p5.9 p5.8 an7 an6 an5 an4 an3 an2 an1 an0 an15 an14 an13 an12 an11 an10 an9 an8 t2eud t4eud t5in t6in t5eud t6eud
st10f269 79/160 port 5 pins have a special port structure (see figure 35), first because it is an input only port, and second because the analog input channels are directly connected to the pins rather than to the input latches. 12.8.2 - port 5 schmitt trigger analog inputs a schmitt trigger protection can be activated on each pin of port 5 by setting the dedicated bit of register p5didis. p5didis (ffa4h / d2h) sfr reset value: 0000h 12.9 - port 6 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp6. each port line can be switched into push/pull or open drain mode via the open drain control register odp6. p6 (ffcch / e6h) sfr reset value: --00h dp6 (ffceh / e7h) sfr reset value: --00h figure 35 : block diagram of a port 5 pin 1514131211109876543210 p5di dis.15 p5di dis.14 p5di dis.13 p5di dis.12 p5di dis.11 p5di dis.10 p5di dis.9 p5di dis.8 p5di dis.7 p5di dis.6 p5di dis.5 p5di dis.4 p5di dis.3 p5di dis.2 p5di dis.1 p5di dis.0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw p5didis.y port 5 digital disable register bit y p5didis.y = 0: port line p5.y digital input is enabled (schmitt trigger enabled) p5didis.y = 1: port line p5.y digital input is disabled (schmitt trigger disabled, necessary for input leakage current reduction) 1514131211109876543210 - - - - - - - - p6.7 p6.6 p6.5 p6.4 p6.3 p6.2 p6.1 p6.0 rw rw rw rw rw rw rw rw p6.y port data register p6 bit y 1514131211109876543210 - - - - - - - - dp6.7 dp6.6 dp6.5 dp6.4 dp6.3 dp6.2 dp6.1 dp6.0 rw rw rw rw rw rw rw rw read port p5.y internal bus input latch clock p5.y/any read buffer to sample + hold circuit channel select analog switch y = 15...0
st10f269 80/160 odp6 (f1ceh / e7h) esfr reset value: --00h 12.9.1 - alternate functions of port 6 a programmable number of chip select signals (cs4 ...cs0 ) derived from the bus control registers (buscon4...buscon0) can be output on 5 pins of port 6. the number of chip select signals is selected via port0 during reset. the selected value can be read from bit-field cssel in register rp0h (read only) in order to check the configuration during run time. the table 19 summarizes the alternate functions of port 6 depending on the number of selected chip select lines (coded via bit-field cssel). figure 36 : port 6 i/o and alternate functions dp6.y port direction register dp6 bit y dp6.y = 0: port line p6.y is an input (high impedance) dp6.y = 1: port line p6.y is an output 1514131211109876543210 --------odp6.7odp6.6odp6.5odp6.4odp6.3odp6.2odp6.1odp6.0 rw rw rw rw rw rw rw rw odp6.y port 6 open drain control register bit y odp6.y = 0: port line p6.y output driver in push-pull mode odp6.y = 1: port line p6.y output driver in open drain mode table 19 : port 6 alternate functions port 6 alternate function cssel = 10 alternate function cssel = 01 alternate function cssel = 00 alternate function cssel = 11 p6.0 p6.1 p6.2 p6.3 p6.4 general purpose i/o general purpose i/o general purpose i/o general purpose i/o general purpose i/o chip select cs0 chip select cs1 general purpose i/o general purpose i/o general purpose i/o chip select cs0 chip select cs1 chip select cs2 general purpose i/o general purpose i/o chip select cs0 chip select cs1 chip select cs2 chip select cs3 chip select cs4 p6.5 p6.6 p6.7 hold external hold request input hlda hold acknowledge output breq bus request output port 6 alternate function a) general purpose input/output p6.7 p6.6 p6.5 p6.4 p6.3 p6.2 p6.1 p6.0 breq hlda hold cs4 cs3 cs2 cs1 cs0
st10f269 81/160 the chip select lines of port 6 have an internal weak pull-up device. this device is switched on during reset. this feature is implemented to drive the chip select lines high during reset in order to avoid multiple chip selection. after reset the cs function must be used, if selected so. in this case there is no possibility to program any port latches before. thus the alternate function (cs ) is selected automatically in this case. note: the open drain output option can only be selected via software earliest during the initialization routine; at least signal cs0 will be in push/pull output driver mode directly after reset. figure 37 : block diagram of port 6 pins with an alternate output function mux 0 1 "0" open drain latch write odp6.y read odp6.y direction latch write dp6.y read dp6.y internal bus mux 0 1 input latch clock p6.y output buffer port output latch read p6.y write dp6.y alternate data output mux 0 1 mux 0 1 "1" mux alternate function enable y = (0...4, 6, 7)
st10f269 82/160 figure 38 : block diagram of pin p6.5 (hold ) open drain latch write odp6.5 read odp6.5 direction latch write dp6.5 read dp6.5 internal bus mux 0 1 input latch clock p6.5/hold output buffer port output latch read p6.5 write p6.5 alternate data input
st10f269 83/160 12.10 - port 7 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp7. each port line can be switched into push-pull or open drain mode via the open drain control register odp7. p7 (ffd0h / e8h) sfr reset value: --00h dp7 (ffd2h / e9h) sfr reset value: --00h odp7 (f1d2h / e9h) esfr reset value: --00h 1514131211109876543210 - - - - - - - - p7.7 p7.6 p7.5 p7.4 p7.3 p7.2 p7.1 p7.0 rw rw rw rw rw rw rw rw p7.y port data register p7 bit y 1514131211109876543210 - - - - - - - - dp7.7 dp7.6 dp7.5 dp7.4 dp7.3 dp7.2 dp7.1 dp7.0 rw rw rw rw rw rw rw rw dp7.y port direction register dp7 bit y dp7.y = 0: port line p7.y is an input (high impedance) dp7.y = 1: port line p7.y is an output 1514131211109876543210 --------odp7.7odp7.6odp7.5 odp7.4 odp7.3 odp7.2 odp7.1 odp7.0 rw rw rw rw rw rw rw rw odp7.y port 7 open drain control register bit y odp7.y = 0: port line p7.y output driver in push-pull mode odp7.y = 1: port line p7.y output driver in open drain mode
st10f269 84/160 12.10.1 - alternate functions of port 7 the upper 4 lines of port 7 (p7.7...p7.4) serve as capture inputs or compare outputs (cc31io...cc28io) for the capcom2 unit. the usage of the port lines by the capcom unit, its accessibility via software and the precautions are the same as described for the port 2 lines. as all other capture inputs, the capture input function of pins p7.7...p7.4 can also be used as external interrupt inputs (200ns sample rate at 40mhz cpu clock). the lower 4 lines of port 7 (p7.3...p7.0) serve as outputs from the pwm module (pout3...pout0). at these pins the value of the respective port output latch is exored with the value of the pwm output rather than anded, as the other pins do. this allows to use the alternate output value either as it is (port latch holds a 0) or to invert its level at the pin (port latch holds a 1). note that the pwm outputs must be enabled via the respective penx bit in pwmcon1. the table 20 summarizes the alternate functions of port 7. table 20 : port 7 alternate functions port 7 alternate function p7.0 p7.1 p7.2 p7.3 p7.4 p7.5 p7.6 p7.7 pout0 pwm mode channel 0 output pout1 pwm mode channel 1 output pout2 pwm mode channel 2 output pout3 pwm mode channel 3 output cc28io capture input / compare output channel 28 cc29io capture input / compare output channel 29 cc30io capture input / compare output channel 30 cc31io capture input / compare output channel 31 figure 39 : port 7 i/o and alternate functions port 7 alternate function general purpose input/output p7.7 p7.6 p7.5 p7.4 p7.3 p7.2 p7.1 p7.0 cc31io cc30io cc29io cc28io pout3 pout2 pout1 pout0
st10f269 85/160 the structure of port 7 differs in the way the output latches are connected to the internal bus and to the pin driver. pins p7.3...p7.0 (pout3...pout0) exor the alternate data output with the port latch output, which allows to use the alternate data directly or inverted at the pin driver. figure 40 : block diagram of port 7 pins p7.3...p7.0 open drain latch write odp7.y read odp7.y direction latch write dp7.y read dp7.y internal bus mux 0 1 input latch clock p7.y/pouty output buffer y = 0...3 port output latch read p7.y write dp7.y =1 port data output exor alternate data output
st10f269 86/160 figure 41 : block diagram of port 7 pins p7.7...p7.4 open drain latch write odp7.y read odp7.y direction latch write dp7.y read dp7.y internal bus mux 0 1 alternate latch data input input latch clock p7.y cczio output buffer alternate data output mux 0 1 output latch 3 1 write port p7.y compare trigger read p7.y y = (4...7) z = (28...31) alternate pin data input
st10f269 87/160 12.11 - port 8 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corresponding direction register dp8. each port line can be switched into push/pull or open drain mode via the open drain control register odp8. p8 (ffd4h / eah) sfr reset value: --00h dp8 (ffd6h / ebh) sfr reset value: --00h odp8 (f1d6h / ebh) esfr reset value: --00h 1514131211109876543210 - - - - - - - - p8.7 p8.6 p8.5 p8.4 p8.3 p8.2 p8.1 p8.0 rw rw rw rw rw rw rw rw p8.y port data register p8 bit y 1514131211109876543210 - - - - - - - - dp8.7 dp8.6 dp8.5 dp8.4 dp8.3 dp8.2 dp8.1 dp8.0 rw rw rw rw rw rw rw rw dp8.y port direction register dp8 bit y dp8.y = 0: port line p8.y is an input (high impedance) dp8.y = 1: port line p8.y is an output 1514131211109876543210 --------odp8.7odp8.6odp8.5odp8.4odp8.3odp8.2odp8.1odp8.0 rw rw rw rw rw rw rw rw odp8.y port 8 open drain control register bit y odp8.y = 0: port line p8.y output driver in push-pull mode odp8.y = 1: port line p8.y output driver in open drain mode
st10f269 88/160 12.11.1 - alternate functions of port 8 the 8 lines of port 8 serve as capture inputs or as compare outputs (cc23io...cc16io) for the capcom2 unit. the usage of the port lines by the capcom unit, its accessibility via software and the precautions are the same as described for the port 2 lines. as all other capture inputs, the capture input function of pins p8.7...p8.0 can also be used as external interrupt inputs (200ns sample rate at 40mhz cpu clock). the table 21 summarizes the alternate functions of port 8. table 21 : port 8 alternate functions port 7 alternate function p8.0 p8.1 p8.2 p8.3 p8.4 p8.5 p8.6 p8.7 cc16io capture input / compare output channel 16 cc17io capture input / compare output channel 17 cc18io capture input / compare output channel 18 cc19io capture input / compare output channel 19 cc20io capture input / compare output channel 20 cc21io capture input / compare output channel 21 cc22io capture input / compare output channel 22 cc23io capture input / compare output channel 23 figure 42 : port 8 i/o and alternate functions port 8 alternate function general purpose input / output p8.7 p8.6 p8.5 p8.4 p8.3 p8.2 p8.1 p8.0 cc23io cc22io cc21io cc20io cc19io cc18io cc17io cc16io
st10f269 89/160 the structure of port 8 differs in the way the output latches are connected to the internal bus and to the pin driver (see figure 43). pins p8.7...p8.0 (cc23io...cc16io) combine internal bus data and alternate data output before the port latch input, as do the port 2 pins. figure 43 : block diagram of port 8 pins p8.7...p8.0 open drain latch write odp8.y read odp8.y direction latch write dp8.y read dp8.y internal bus mux 0 1 alternate latch data input input latch clock p8.y cczio output buffer alternate data output mux 0 1 output latch 3 1 write port p8.y compare trigger read p8.y y = (7...0) z = (16...23) alternate pin data input
st10f269 90/160 13 - a/d converter a 10-bit a/d converter with 16 multiplexed input channels and a sample and hold circuit is integrated on-chip. the sample time (for loading the capacitors) and the conversion time is programmable and can be adjusted to the external circuitry. to remove high frequency components from the analog input signal, a low-pass filter must be con- nected at the adc input. overrun error detection / protection is controlled by the addat register. either an interrupt request is generated when the result of a previous conversion has not been read from the result register at the time the next conversion is complete, or the next conversion is suspended until the previous result has been read. for applications which require less than 16 analog input channels, the remaining channel inputs can be used as digital input port pins. the a/d converter of the st10f269 supports different conversion modes : C single channel single conversion : the analog level of the selected channel is sampled once and converted. the result of the conversion is stored in the addat register. C single channel continuous conversion : the analog level of the selected channel is repeated- ly sampled and converted. the result of the con- version is stored in the addat register. C auto scan single conversion : the analog level of the selected channels are sampled once and converted. after each conversion the result is stored in the addat register. the data can be transfered to the ram by interrupt software management or using the powerfull peripheral event controller (pec) data transfert. C auto scan continuous conversion : the ana- log level of the selected channels are repeatedly sampled and converted. the result of the con- version is stored in the addat register. the data can be transfered to the ram by interrupt software management or using the pec data transfert. C wait for addat read mode : when using con- tinuous modes, in order to avoid to overwrite the result of the current conversion by the next one, the adwr bit of adcon control register must be activated. then, until the addat regis- ter is read, the new result is stored in a tempo- rary buffer and the conversion is on hold. C channel injection mode : when using continuous modes, a selected channel can be converted in between without changing the current operating mode. the 10-bit data of the conversion are stored in adres field of addat2. the current continuous mode remains active after the single conversion is completed. notes: 1. section 21.4.5 - direct drive for tcl definition. 2. t cc = tcl x 24 table 22 : adc sample clock and conversion clock adctc conversion clock t cc adstc sample clock t sc tcl 1 = 1/2 x f xtal at f cpu = 40mhz t sc = at f cpu = 40mhz 00 tcl x 24 0.3 m s00 t cc 0.3 m s 2 01 reserved, do not use reserved 01 t cc x 2 0.6 m s 2 10 tcl x 96 1.2 m s10t cc x 4 1.2 m s 2 11 tcl x 48 0.6 m s11t cc x 8 2.4 m s 2
st10f269 91/160 14 - serial channels serial communication with other microcontrollers, microprocessors, terminals or external peripheral components is provided by two serial interfaces: the asynchronous / synchronous serial channel (asco) and the high-speed synchronous serial channel (ssc). two dedicated baud rate generators set up all standard baud rates without the requirement of oscillator tuning. for transmission, reception and erroneous reception, 3 separate interrupt vectors are provided for each serial channel. 14.1 - asynchronous / synchronous serial interface (asco) the asynchronous / synchronous serial interface (asco) provides serial communication between the st10f269 and other microcontrollers, microprocessors or external peripherals. a set of registers is used to configure and to control the asco serial interface: C p3, dp3, odp3 for pin configuration C sobg for baud rate generator C sotbuf for transmit buffer C sotic for transmit interrupt control C sotbic for transmit buffer interrupt control C socon for control C sorbuf for receive buffer (read only) C soric for receive interrupt control C soeic for error interrupt control 14.1.1 - asco in asynchronous mode in asynchronous mode, 8 or 9-bit data transfer, parity generation and the number of stop bit can be selected. parity framing and overrun error detection is provided to increase the reliability of data transfers. transmission and reception of data is double-buffered. full-duplex communication up to 1.25m bauds (at 40mhz of f cpu ) is supported in this mode. figure 44 : asynchronous mode of serial channel asc0 pin 2 cpu clock s0r baud rate timer reload register 16 clock serial port control shift clock s0m s0stp s0fe s0oe s0pe s0ren s0fen s0pen s0oen s0lb s0rir s0tir s0eir receive interrupt request transmit interrupt request error interrupt request transmit shift register receive shift register txd0 / p3.10 transmit buffer register s0tbuf receive buffer register s0rbuf sampling mux 0 1 pin input internal bus rxd0/p3.11 output
st10f269 92/160 asynchronous mode baud rates for asynchronous operation, the baud rate generator provides a clock with 16 times the rate of the established baud rate. every received bit is sampled at the 7th, 8th and 9th cycle of this clock. the baud rate for asynchronous operation of serial channel asc0 and the required reload value for a given baud rate can be determined by the following formulas: (s0brl) represents the content of the reload register, taken as unsigned 13-bit integer, (s0brs) represents the value of bit s0brs (0 or 1), taken as integer. using the above equation, the maximum baud rate can be calculated for any given clock speed. baud rate versus reload register value (sobrs=0 and sobrs=1) is described in table 23. note: the deviation errors given in the table 23 are rounded. to avoid deviation errors use a baud rate crystal (providing a multiple of the asc0/ssc sampling frequency). b async = f cpu 16 x [2 + (s0brs)] x [(s0brl) + 1] s0brl = ( f cpu 16 x [2 + (s0brs)] x b async ) - 1 table 23 : commonly used baud rates by reload value and deviation errors s0brs = 0, f cpu = 40mhz s0brs = 1, f cpu = 40mhz baud rate (baud) deviation error reload value (hexa) baud rate (baud) deviation error reload value (hexa) 1 250 000 0.0% / 0.0% 0000 / 0000 833 333 0.0% / 0.0% 0000 / 0000 112 000 +1.5% / -7.0% 000a / 000b 112 000 +6.3% / -7.0% 0006 / 0007 56 000 +1.5% / -3.0% 0015 / 0016 56 000 +6.3% / -0.8% 000d / 000e 38 400 +1.7% / -1.4% 001f / 0020 38 400 +3.3% / -1.4% 0014 / 0015 19 200 +0.2% / -1.4% 0040 / 0041 19 200 +0.9% / -1.4% 002a / 002b 9 600 +0.2% / -0.6% 0081 / 0082 9 600 +0.9% / -0.2% 0055 / 0056 4 800 +0.2% / -0.2% 0103 / 0104 4 800 +0.4% / -0.2% 00ac / 00ad 2 400 +0.2% / -0.0% 0207 / 0208 2 400 +0.1% / -0.2% 015a / 015b 1 200 0.1% / 0.0% 0410 / 0411 1 200 +0.1% / -0.1% 02b5 / 02b6 600 0.0% / 0.0% 0822 / 0823 600 +0.1% / -0.0% 056b / 056c 300 0.0% / 0.0% 1045 / 1046 300 0.0% / 0.0% 0ad8 / 0ad9 153 0.0% / 0.0% 1fe8 / 1fe9 102 0.0% / 0.0% 1fe8 / 1fe9
st10f269 93/160 14.1.2 - asco in synchronous mode in synchronous mode, data are transmitted or received synchronously to a shift clock which is generated by the st10f269. half-duplex communication up to 5m baud (at 40mhz of f cpu ) is possible in this mode. figure 45 : synchronous mode of serial channel asc0 2 cpu clock s0r baud rate timer reload register 4 clock serial port control shift clock s0m = 000b s0oe s0ren s0oen s0lb s0rir s0tir s0eir receive interrupt request transmit interrupt request error interrupt request transmit shift register receive shift register transmit buffer register s0tbuf receive buffer register s0rbuf mux 0 1 pin internal bus receive output transmit pin input/output tdx0/p3.10 rxd0/p3.11
st10f269 94/160 synchronous mode baud rates for synchronous operation, the baud rate generator provides a clock with 4 times the rate of the established baud rate. the baud rate for synchronous operation of serial channel asc0 can be determined by the following formula: (s0brl) represents the content of the reload register, taken as unsigned 13-bit integers, (s0brs) represents the value of bit s0brs (0 or 1), taken as integer. using the above equation, the maximum baud rate can be calculated for any clock speed as given in table 24. note: the deviation errors given in the table 24 are rounded. to avoid deviation errors use a baud rate crystal (providing a multiple of the asc0/ssc sampling frequency) b sync = s0brl = ( f cpu 4 x [2 + (s0brs)] x b sync ) - 1 f cpu 4 x [2 + (s0brs)] x [(s0brl) + 1] table 24 : commonly used baud rates by reload value and deviation errors s0brs = 0, f cpu = 40mhz s0brs = 1, f cpu = 40mhz baud rate (baud) deviation error reload value (hexa) baud rate (baud) deviation error reload value (hexa) 5 000 000 0.0% / 0.0% 0000 / 0000 3 333 333 0.0% / 0.0% 0000 / 0000 112 000 +1.5% / -0.8% 002b / 002c 112 000 +2.6% / -0.8% 001c / 001d 56 000 +0.3% / -0.8% 0058 / 0059 56 000 +0.9% / -0.8% 003a / 003b 38 400 +0.2% / -0.6% 0081 / 0082 38 400 +0.9% / -0.2% 0055 / 0056 19 200 +0.2% / -0.2% 0103 / 0104 19 200 +0.4% / -0.2% 00ac / 00ad 9 600 +0.2% / -0.0% 0207 / 0208 9 600 +0.1% / -0.2% 015a / 015b 4 800 +0.1% / -0.0% 0410 / 0411 4 800 +0.1% / -0.1% 02b5 / 02b6 2 400 0.0% / 0.0% 0822 / 0823 2 400 +0.1% / -0.0% 056b / 056c 1 200 0.0% / 0.0% 1045 / 1046 1 200 0.0% / 0.0% 0ad8 / 0ad9 900 0.0% / 0.0% 15b2 / 15b3 600 0.0% / 0.0% 15b2 / 15b3 612 0.0% / 0.0% 1fe8 / 1fe9 407 0.0% / 0.0% 1ffd / 1ffe
st10f269 95/160 14.2 - high speed synchronous serial channel (ssc) the high-speed synchronous serial interface ssc provides flexible high-speed serial communication between the st10f269 and other microcontrollers, microprocessors or external peripherals. the ssc supports full-duplex and half-duplex synchronous communication. the serial clock signal can be generated by the ssc itself (master mode) or be received from an external master (slave mode). data width, shift direction, clock polarity and phase are programmable. this allows communication with spi-compatible devices. transmission and reception of data is double-buffered. a 16-bit baud rate generator provides the ssc with a separate serial clock signal. the serial channel ssc has its own dedicated 16-bit baud rate generator with 16-bit reload capability, allowing baud rate generation independent from the timers. figure 46 : synchronous serial channel ssc block diagram baud rate generator ssc control block pin internal bus clock control cpu clock slave clock master clock sclk shift clock status control receive interrupt request transmit interrupt request error interrupt request 16-bit shift register pin control pin pin mtsr mrst transmit buffer register ssctb receive buffer register sscrb
st10f269 96/160 baud rate generation the baud rate generator is clocked by f cpu /2. the timer is counting downwards and can be started or stopped through the global enable bit sscen in register ssccon. register sscbr is the dual-function baud rate generator/reload register. reading sscbr, while the ssc is enabled, returns the content of the timer. reading sscbr, while the ssc is disabled, returns the programmed reload value. in this mode the desired reload value can be written to sscbr. note never write to sscbr, while the ssc is enabled. the formulas below calculate the resulting baud rate for a given reload value and the required reload value for a given baud rate: (sscbr) represents the content of the reload register, taken as unsigned 16-bit integer. table 25 lists some possible baud rates against the required reload values and the resulting bit times for a 40mhz cpu clock. baud rate ssc = f cpu 2 x [(sscbr) + 1] sscbr = ( f cpu 2 x baud rate ssc ) - 1 table 25 : synchronous baud rate and reload values baud rate bit time reload value reserved use a reload value > 0. --- --- 10m baud 100ns 0001h 5m baud 200ns 0003h 2.5m baud 400ns 0007h 1m baud 1 m s 0013h 100k baud 10 m s 00c7h 10k baud 100 m s 07cfh 1k baud 1ms 4e1fh 306 baud 3.26ms ff4eh
st10f269 97/160 15 - can modules the two integrated can modules (can1 and can2) are identical and handle the completely autonomous transmission and reception of can frames according to the can specification v2.0 part b (active). each on-chip can module can receive and transmit standard frames with 11-bit identifiers as well as extended frames with 29-bit identifiers. these two can modules are both identical to the can module of the st10f167. because of duplication of the can controllers, the following adjustments are to be considered: C same internal register addresses of both can controllers, but with base addresses differing in address bit a8; separate chip select for each can module. refer to chapter 4 - memory or- ganization. C the can1 transmit line (can1_txd) is the alternate function of the port p4.6 pin and the receive line (can1_rxd) is the alternate function of the port p4.5 pin. C the can2 transmit line (can2_txd) is the alternate function of the port p4.7 pin and the receive line (can2_rxd) is the alternate function of the port p4.4 pin. C interrupt request line of the can1 module is connected to the xbus interrupt line xp0, interrupt of the can2 module is connected to the line xp1. C the can modules must be selected with corresponding canxen bit of xpercon register before the bit xpen of syscon register is set. C the reset default configuration is : can1 is enabled, can2 is disabled. 15.1 - can modules memory mapping 15.1.1 - can1 address range 00ef00h - 00efffh is reserved for the can1 module access. can1 is enabled by setting xpen bit 2 of the syscon register and by setting bit 0 of the xpercon register. accesses to the can module use demultiplexed addresses and a 16-bit data bus (byte accesses are possible). two wait states give an access time of 125ns at 40mhz cpu clock. no tri-state wait states are used. 15.1.2 - can2 address range 00ee00h - 00eeffh is reserved for the can2 module access. can2 is enabled by setting xpen bit 2 of the syscon register and by setting bit 1 of the xpercon register. accesses to the can module use demultiplexed addresses and a 16-bit data bus (byte accesses are possible). two wait states give an access time of 125ns at 40mhz cpu clock. no tri-state wait states are used. note: if one or both can modules is used, port 4 cannot be programmed to output all 8 segment address lines. thus, only 4 segment address lines can be used, reducing the external memory space to 5m bytes (1m byte per cs line). 15.2 - can bus configurations depending on application, can bus configuration may be one single bus with a single or multiple interfaces or a multiple bus with a single or multiple interfaces. the st10f269 is able to support these 2 cases. single can bus the single can bus multiple interfaces configuration may be implemented using 2 can transceives as shown in figure 47. figure 47 : single can bus multiple interfaces, multiple transceivers can1 rxd txd can2 rxd txd can transceiver can transceiver can_h can_h can bus
st10f269 98/160 the st10f269 also supports single can bus multiple (dual) interfaces using the open drain option of the canx_txd output as shown in figure 48. thanks to the or-wired connection, only one transceiver is required. in this case the design of the application must take in account the wire length and the noise environment. multiple can bus the st10f269 provides 2 can interfaces to support such kind of bus configuration as shown in figure 49. figure 48 : single can bus, dual interfaces, single transceiver can1 rxd txd can2 rxd txd can transceiver can_h can_h can bus * open drain output +5v 2.7k w * * figure 49 : connection to two different can buses (e.g. for gateway application) can1 rxd txd can2 rxd txd can transceiver can transceiver can_h can_h can can bus 2 bus 1
st10f269 99/160 16 - real time clock the real time clock is an independent timer, which clock is directly derived from the clock oscillator on xtal1 input so that it can keep on running even in idle or power down mode (if enabled to). registers access is implemented onto the xbus. this module is designed for the following purposes: C generate the current time and date for the system C cyclic time based interrupt, provides port 2 external interrupts every second and every n seconds (n is programmable) if enabled. C 58-bit timer for long term measurement C capable to exit the st10 chip from power down mode (if pwdcfg of syscon set) after a pro- grammed delay. the real time clock is base on two main blocks of counters. the first block is a prescaler which generates a basic reference clock (for example a 1 second period). this basic reference clock is coming out of a 20-bit divider (4-bit msb rtcdh counter and 16-bit lsb rtcdl counter). this 20-bit counter is driven by an input clock derivated from the on-chip high frequency cpu clock, predivided by a 1/64 fixed counter (see figure 51). this 20-bit counter is loaded at each basic reference clock period with the value of the 20-bit prescaler register (4-bit msb rtcph register and 16-bit lsb rtcpl register). the value of the 20-bit rtcp register determines the period of the basic reference clock. a timed interrupt request (rtcsi) may be sent on each basic reference clock period. the second block of the rtc is a 32-bit counter (16-bit rtch and 16-bit rtcl). this counter may be initialized with the current system time. rtch/rtcl counter is driven with the basic reference clock signal. in order to provide an alarm function the contents of rtch/rtcl counter is compared with a 32-bit alarm register (16-bit rtcah register and 16-bit rtcal register). the alarm register may be loaded with a reference date. an alarm interrupt request (rtcai), may be generated when the value of rtch/rtcl counter matches the reference date of rtcah/rtcal register. the timed rtcsi and the alarm rtcai interrupt requests can trigger a fast external interrupt via exisel register of port 2 and wake-up the st10 chip when running power down mode. using the rtcoff bit of rtccon register, the user may switch off the clock oscillator when entering the power down mode. figure 50 : esfrs and port pins associated with the rtc figure 51 : rtc block diagram ---- - - --yyyy---- exisel exisel external interrupt source selection register (port 2) 1 second timed interrupt request (rtcsi) triggers firq[2] and alarm interrupt request (rtcai) triggers firq[3] rtc data and control registers are implemented onto the xbus. ---- - - - - yyyyyyyy ccxic /64 rtcpl rtcph rtch rtcl rtcdh rtcdl rtcah rtcal clock oscillator reload = 20 bit divider 32 bit counter rtccon alarmit basic clock it rtcai rtcsi programmable alarm register programmable prescaler register
st10f269 100/160 16.1 - rtc registers 16.1.1 - rtccon: rtc control register the functions of the rtc are controlled by the rtccon control register. if the rtoff bit is set, the rtc dividers and counters clock is disabled and registers can be written, when the st10 chip enters power down mode the clock oscillator will be switch off. the rtc has 2 interrupt sources, one is triggered every basic clock period, the other one is the alarm. rtccon includes an interrupt request flag and an interrupt enable bit for each of them. this register is read and written via the xbus. rtccon (ec00h) xbus reset value: --00h notes: 1. as rtccon register is not bit-addressable, the value of these bits must be read by checking their associated ccxic re gister. the 2 rtc interrupt signals are connected to port2 in order to trigger an external interrupt that wake up the chip when in powe r down mode. 2. all the bit of rtccon are active high. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 - - - - - - - - rtcoff - - - rtcaen rtcair rtcsen rtcsir rw rw rw rw rw rtcoff 2 rtc switch off bit 0: clock oscillator and rtc keep on running even if st10 in power down mode 1: clock oscillator is switch off if st10 enters power down mode, rtc dividers and counters are stopped and registers can be written rtcaen 2 rtc alarm interrupt enable 0: rtcai is disabled 1: rtcai is enabled, it is generated every n seconds rtcair 1 rtc alarm interrupt request flag (when the alarm is triggered) 0: the bit was reseted less than a n seconds ago 1: the interrupt was triggered rtcsen 2 rtc second interrupt enable 0: rtcsi is disabled 1: rtcsi is enabled, it is generated every second rtcsir 1 rtc second interrupt request flag (every second) 0: the bit was reseted less than a second ago 1: the interrupt was triggered
st10f269 101/160 16.1.2 - rtcph & rtcpl: rtc prescaler registers the 20-bit programmable prescaler divider is loaded with 2 registers. the 4 most significant bit are stored into rtcph and the 16 less significant bit are stored in rtcpl. in order to keep the system clock, those registers are not reset. they are write protected by bit rtoff of rtccon register, write operation is allowed if rtoff is set. rtcpl (ec06h) xbus reset value: xxxxh rtcph (ec08h) xbus reset value: ---xh the value stored into rtcph, rtcpl is called rtcp (coded on 20-bit). the dividing ratio of the prescalar divider is: ratio = 64 x (rtcp) 16.1.3 - rtcdh & rtcdl: rtc divider counters every basic reference clock the divider counters are reloaded with the value stored rtcph and rtcpl registers. to get an accurate time measurement it is possible to read the value of the divider, reading the rtcdh, rtcdl. those counters are read only. after any bit changed in the programmable prescaler register, the new value is loaded in the divider. rtcdl (ec0ah) xbus reset value: xxxxh rtcdh (ec0ch) xbus reset value: ---xh note: those registers are not reset, and are read only. 1514131211109876543210 rtcpl rw 1514131211109876543210 reserved rtcph rw figure 52 : prescaler register 1514131211109876543210 rtcdl r 1514131211109876543210 reserved rtcdh r 3 2 1 0 7 6 5 4 11 10 9 8 15 14 13 12 3 2 1 0 rtcph rtcpl 3 2 1 0 7 6 5 4 11 10 9 8 15 14 13 12 19 18 17 16 20 bit word counter
st10f269 102/160 when rtcd increments to reach 00000h, the 20-bit word stored into rtcph, rtcpl registers is loaded in rtcd. bit 15 to bit 4 of rtcph and rtcdh are not used. when reading, the return value of those bit will be zeros. 16.1.4 - rtch & rtcl: rtc programmable counter registers the rtc has 2 x 16-bit programmable counters which count rate is based on the basic time reference (for example 1 second). as the clock oscillator may be kept working, even in power down mode, the rtc counters may be used as a system clock. in addition rtc counters and registers are not modified at any system reset. the only way to force their value is to write them via the xbus. those counters are write protected as well. the bit rtoff of the rtccon register must be set (rtc dividers and counters are stopped) to enable a write operation on rtch or rtcl. a write operation on rtch or rtcl register loads directly the corresponding counter. when reading, the current value in the counter (system date) is returned. the counters keeps on running while the clock oscillator is working. rtcl (ec0eh) xbus reset value: xxxxh rtch (ec10h) xbus reset value: xxxxh note: those registers are nor reset figure 53 : divider counters 1514131211109876543210 rtcl rw 1514131211109876543210 rtch rw 3 2 1 0 7 6 5 4 11 10 9 8 15 14 13 12 3 2 1 0 rtcdh rtcdl 3 2 1 0 7 6 5 4 11 10 9 8 15 14 13 12 19 18 17 16 20 bit word internal value of the prescalar divider
st10f269 103/160 16.1.5 - rtcah & rtcal: rtc alarm registers when the programmable counters reach the 32-bit value stored into rtcah & rtcal registers, an alarm is triggered and the interrupt request rtair is generated. those registers are not protected. rtcal (ec12h) xbus reset value: xxxxh rtcah (ec14h) xbus reset value: xxxxh note: those registers are not reset 16.2 - programming the rtc rtc interrupt request signals are connected to port2, pad 10 (rtcsi) and pad 11 (rtcai). an alternate function port2 is to generate fast interrupts firq[7:0]. to trigger firq[2] and firq[3] the following configuration has to be set. exicon esfr controls the external interrupt edge selection, rtc interrupt requests are rising edge active. exicon (f1c0h) esfr reset value: 0000h notes: 1. exi2es and exi3es must be configured as "01b" because rct interrupt request lines are rising edge active. 2. alarm interrupt request line (rtcai) is linked with exi3es. 3. timed interrupt request line (rtcsi) is linked with exi2es. exisel esfr enables the port2 alternate sources. rtc interrupts are alternate sources 2 and 3. exisel (f1dah) esfr reset value: 0000h notes: 1. advised configuration. 2. alarm interrupt request (rtcai) is linked with exi3ss. 3. timed interrupt request (rtcsi) is linked with exi2ss. 1514131211109876543210 rtcal rw 1514131211109876543210 rtcah rw 1514131211109876543210 exi7es exi6es exi5es exi4es exi3es 1 2 exi2es 1 3 exi1es exi0es rw rw rw rw rw rw rw rw 1514131211109876543210 exi7ss exi6ss exi5ss exi4ss exi3ss 2 exi2ss 3 exi1ss exi0ss rw rw rw rw rw rw rw rw exixss external interrupt x source selection (x=7...0) 00: input from associated port 2 pin. 01: input from alternate source. 1 10: input from port 2 pin ored with alternate source. 1 11: input from port 2 pin anded with alternate source.
st10f269 104/160 interrupt control registers are common with capcom1 unit: cc10ic (rtcsi) and cc11ic (rtcai). ccxic sfr reset value: --00h cc10ic: ff8ch/c6h cc11ic: ff8eh/c7h 1514131211109876543210 -------- ccxir ccxie ilvl glvl rw rw rw rw source of interrupt request flag enable flag interrupt vector vector location trap number external interrupt 2 cc10ir cc10ie cc10int 000068h 1ah/26 external interrupt 3 cc11ir cc11ie cc11int 00006ch 1bh/27
st10f269 105/160 17 - watchdog timer the watchdog timer is a fail-safe mechanism which prevents the microcontroller from malfunctioning for long periods of time. the watchdog timer is always enabled after a reset of the chip and can only be disabled in the time interval until the einit (end of initialization) instruction has been executed. therefore, the chip start-up procedure is always monitored. the software must be designed to service the watchdog timer before it overflows. if, due to hardware or software related failures, the software fails to do so, the watchdog timer overflows and generates an internal hardware reset. it pulls the rstout pin low in order to allow external hardware components to be reset. each of the different reset sources is indicated in the wdtcon register. the indicated bits are cleared with the einit instruction. the origine of the reset can be identified during the initialization phase. wdtcon (ffaeh / d7h) sfr reset value: 00xxh notes: 1. more than one reset indication flag may be set. after einit, all flags are cleared. 2. power-on is detected when a rising edge from v dd = 0 v to v dd > 2.0 v is recognized on the internal 3.3v supply. 3. these bits cannot be directly modified by software. 1514131211109876543210 wdtrel - - ponr lhwr shwr swr wdtr wdtin rw hr hr hr hr hr rw wdtin watchdog timer input frequency selection 0: input frequency is f cpu /2. 1: input frequency is f cpu /128. wdtr 1-3 watchdog timer reset indication flag set by the watchdog timer on an overflow. cleared by a hardware reset or by the srvwdt instruction. swr 1-3 software reset indication flag set by the srst execution. cleared by the einit instruction. shwr 1-3 short hardware reset indication flag set by the input rstin . cleared by the einit instruction. lhwr 1-3 long hardware reset indication flag set by the input rstin . cleared by the einit instruction. ponr 1- 2-3 power-on (asynchronous) reset indication flag set by the input rstin if a power-on condition has been detected. cleared by the einit instruction.
st10f269 106/160 the ponr flag of wdtcon register is set if the output voltage of the internal 3.3v supply falls below the threshold (typically 2v) of the power-on detection circuit. this circuit is efficient to detect major failures of the external 5v supply but if the internal 3.3v supply does not drop under 2 volts, the ponr flag is not set. this could be the case on fast switch-off / switch-on of the 5v supply. the time needed for such a sequence to activate the ponr flag depends on the value of the capacitors connected to the supply and on the exact value of the internal threshold of the detection circuit. notes: 1. ponr bit may not be set for short supply failure. 2. for power-on reset and reset after supply partial failure, asynchronous reset must be used. in case of bi-directional reset is enabled, and if the rstin pin is latched low after the end of the internal reset sequence, then a short hardware reset, a software reset or a watchdog reset will trigger a long hardware reset. thus, reset indications flags will be set to indicate a long hardware reset. the watchdog timer is 16-bit, clocked with the system clock divided by 2 or 128. the high byte of the watchdog timer register can be set to a pre-specified reload value (stored in wdtrel). each time it is serviced by the application software, the high byte of the watchdog timer is reloaded. for security, rewrite wdtcon each time before the watchdog timer is serviced the table 27 shows the watchdog time range for 40mhz cpu clock. the watchdog timer period is calculated with the following formula: table 26 : wdtcon bit value on different resets reset source ponr lhwr shwr swr wdtr power on reset x x x x power on after partial supply failure 1) 2) xxx long hardware reset x x x short hardware reset x x software reset x watchdog reset xx table 27 : wdtrel reload value reload value in wdtrel prescaler for f cpu = 40mhz 2 (wdtin = 0) 128 (wdtin = 1) ffh 12.8 m s819.2ms 00h 3.276ms 209.7ms p wdt 1 f cpu --------------- 5 1 2 1wdtin ] 63 ) 256 w dtrel ]) [ C ( [ + ( =
st10f269 107/160 18 - system reset system reset initializes the mcu in a predefined state. there are five ways to activate a reset state. the system start-up configuration is different for each case as shown in table 28. table 28 : reset event definition 18.1 - long hardware reset the reset is triggered when rstin pin is pulled low, then the mcu is immediately forced in reset default state. it pulls low rstout pin, it cancels pending internal hold states if any, it aborts external bus cycle, it switches buses (data, address and control signals) and i/o pin drivers to high-impedance, it pulls high port0 pins and the reset sequence starts. to get a long hardware reset , the duration of the external rstin signal must be longer than 1040 tcl . the level of rpd pin is sampled during the whole rstin pulse duration. a low level on rpd pin determines an asynchronous reset while a high level leads to a synchronous reset . note a reset can be entered as synchronous and exit as asynchronous if v rpd voltage drops below the rpd pin threshold (typically 2.5v for v dd = 5v) when rstin pin is low or when rstin pin is internally pulled low. 18.1.1 - asynchronous reset figure 54 and figure 55 show asynchronous reset condition (rpd pin is at low level) . figure 54 : asynchronous reset sequence external fetch note: 1) rstin rising edge to internal latch of port0 is 3 cpu clock cycles (6 tcl) if the pll is bypassed and the prescaler is on (f cpu =f xtal / 2), else it is 4 cpu clock cycles (8 tcl). reset source short-cut conditions power-on reset ponr power-on long hardware reset (synchronous & asynchronous) lhwr t rstin > 1040 tcl short hardware reset (synchronous reset) shwr 4 tcl < t rstin < 1038 tcl watchdog timer reset wdtr wdt overflow software reset swr srst execution 6 or 8 tcl 1) cpu clock rstin asynchronous reset condition rpd rstout ale port0 reset configuration 1st instruction external fetch latching point of port0 for system start-up configuration 8 1234 67 59 rd external fetch internal reset 5 tcl
st10f269 108/160 figure 55 : asynchronous reset sequence internal fetch note: 1) rstin rising edge to internal latch of port0 is 3 cpu clock cycles (6 tcl) if the pll is bypassed and the prescaler is on (f cpu =f xtal / 2), else it is 4 cpu clock cycles (8 tcl). 2) 2.1s typical value. power-on reset the asynchronous reset must be used during the power-on of the mcu. depending on the crystal frequency, the on-chip oscillator needs about 10ms to 50ms to stabilize. the logic of the mcu does not need a stabilized clock signal to detect an asynchronous reset, so it is suitable for power-on conditions. to ensure a proper reset sequence, the rstin pin and the rpd pin must be held at low level until the mcu clock signal is stabilized and the system configuration value on port0 is settled. hardware reset the asynchronous reset must be used to recover from catastrophic situations of the application. it may be triggerred by the hardware of the application . internal hardware logic and application circuitry are described in section 18.6 - reset circuitry and figure 58, figure 59 and figure 60. 18.1.2 - synchronous reset (rstin pulse > 1040tcl and rpd pin at high level) the synchronous reset is a warm reset. it may be generated synchronously to the cpu clock. to be detected by the reset logic, the rstin pulse must be low at least for 4 tcl (2 periods of cpu clock). then the i/o pins are set to high impedance and rstout pin is driven low. after the rstin level is detected, a short duration of 12 tcl (6 cpu clocks) maximum elapses, during which pending internal hold states are cancelled and the current internal access cycle, if any, is completed. external bus cycle is aborted. the internal pull-down of rstin pin is activated if bit bdrsten of syscon register was previously set by software. this bit is always cleared on power-on or after any reset sequence. the internal sequence lasts for 1024 tcl (512 periods of cpu clock). after this duration the pull-down of rstin pin for the bidirectional reset function is released and the rstin pin level is sampled. at this step the sequence lasts 1040 tcl (4 tcl + 12 tcl + 1024 tcl). if the rstin pin level is low, the reset sequence is extended until rstin level becomes high. refer to figure 56 note if v rpd voltage drops below the rpd pin threshold (typically 2.5v for v dd = 5v) when rstin pin is low or when rstin pin is internally pulled low, the st10 reset circuitry disables the bidirectional reset function and rstin pin is no more pulled low. the reset is processed as an asynchronous reset. 6 or 8 tcl 1) cpu clock rstin asynchronous reset condition rpd rstout port0 reset configuration internal fetch internal reset signal flash read signal pll factor latch command flash under reset for internal charge pump ramping up 1st fetch from flash latching point of port0 for pll configuration latching point of port0 for remaining bits 123 2.5s max. 2)
st10f269 109/160 figure 56 : synchronous reset sequence external fetch (rstin pulse > 1040 tcl) note 1) rstin rising edge to internal latch of port0 is 3 cpu clock cycles (6 tcl) if the pll is bypassed and the prescaler is on (f cpu =f xtal / 2 ), else it is 4 cpu clock cycles (8 tcl). 2) rstin pin is pulled low if bit bdrsten (bit 3 of syscon register) was previously set by software. bit bdrsten is cleared after reset. 3) if during the reset condition (rstin low), v rpd voltage drops below the threshold voltage (typically 2.5v for 5v operation), the the st10 reset circuitry disables the bidirectional reset function and rstin pin is no more pulled low. 18.1.3 - exit of long hardware reset - if the rpd pin level is low when the rstin pin is sampled high , the mcu completes an asynchronous reset sequence. - if the rpd pin level is high when the rstin pin is sampled high , the mcu completes a synchronous reset sequence. the system configuration is latched from port0 after a duration of 8 tcl / 4 cpu clocks (6 tcl / 3 cpu clocks if pll is bypassed) and in case of external fetch, ale, rd and r/w pins are driven to their inactive level. the mcu starts program execution from memory location 00'0000h in code segment 0. this starting location will typically point to the general initialization routine. refer to table 29 for port0 latched configuration. 18.2 - short hardware reset a short hardware reset is a warm reset. it may be generated synchronously to the cpu clock (synchronous reset) . the short hardware is triggered when rstin signal duration is shorter or equal to 1038 tcl, the rpd pin must be pulled high. to properly activate the internal reset logic of the mcu, the rstin pin must be held low, at least, during 4 tcl (2 periods of cpu clock). the i/o pins are set to high impedance and rstout pin is driven low. after rstin level is detected, a short duration of 12 tcl (6 cpu clocks) maximum elapses, during which pending internal hold states are cancelled and the current internal access cycle if any is completed. external bus cycle is aborted. the internal pull-down of rstin pin is activated if bit bdrsten of syscon register was previously set by software. this bit is always cleared on power-on or after any reset sequence. the internal reset sequence starts for 1024 tcl (512 periods of cpu clock). after that duration the pull-down of rstin pin for the bidirectional reset function is released and the rstin pin level is sampled high while rpd level is high. cpu clock rstin rpd rstout ale port0 latching point of port0 for system start-up configuration 6 or 8 tcl 1) 4 tcl 12 tcl min. max. 1024 tcl reset configuration if v rpd > 2.5v asynchronous 200 m a discharge 3) rd 4 3 2 1 5 678 9 reset is not entered. internal reset signal internally pulled low 2) 5 tcl
st10f269 110/160 the short hardware reset ends and the mcu restarts.to be processed as a short hardware reset, the external rstin signal must last a maximum of 1038 tcl (4 tcl + 10 tcl + 1024 tcl). the system configuration is latched from port0 after a duration of 8 tcl / 4 cpu clocks (6 tcl / 3 cpu clocks if pll is bypassed) and in case of external fetch, ale, rd and r/w pins are driven to their inactive level. program execution starts from memory location 00'0000h in code segment 0. this starting location will typically point to the general initialization routine. timings of synchronous reset sequence are summarized in figure 57. refer to table 29 for port0 latched configuration. note - if the rstin pin level is sampled low, the reset sequence is extended until rstin level becomes high leading to a long hardware reset (synchronous or asynchronous reset) because rstin signal duration has lasted longer than 1040tcl. - if the v rpd voltage has droped below the rpd pin threshold, the reset is processed as an asynchronous reset. figure 57 : synchronous warm reset sequence external fetch (4 tcl < rstin pulse < 1038 tcl) note 1) rstin assertion can be released there. 2) maximum internal synchronisation is 6 cpu cycles (12 tcl). 3) rstin pin is pulled low if bit bdrsten (bit 3 of syscon register) was previously set by software. bit bdrsten is cleared after reset. 4) rstin rising edge to internal latch of port0 is 3 cpu clock cycles (6 tcl) if the pll is bypassed and the prescaler is on (f cpu =f xtal / 2 ), else it is 4 cpu clock cycles (8 tcl). 5) if during the reset condition (rstin low), v rpd voltage drops below the threshold voltage (typically 2.5v for 5v operation), the st10 reset circuitry disables the bidirectional reset function and rstin pin is no more pulled low. 18.3 - software reset the reset sequence can be triggered at any time using the protected instruction srst (software reset). this instruction can be executed deliberately within a program, for example to leave bootstrap loader mode, or upon a hardware trap that reveals a system failure. upon execution of the srst instruction, the internal reset sequence (1024 tcl) is started. the microcontroller behavior is the same as for a short hardware reset, except that only p0.12...p0.6 bits are latched at the end of the reset sequence, while previously latched values of p0.5...p0.2 are cleared. 18.4 - watchdog timer reset when the watchdog timer is not disabled during the initialization or when it is not regularly serviced during program execution it will overflow and it will trigger the reset sequence. cpu clock rstin rpd rstout ale port0 1st instr. latching point of port0 for system start-up configuration 6 or 8 tcl 4) 4 tcl 10 tcl 2) min. min. 1024 tcl 1) reset configuration if v rpd > 2.5v asynchronous 200 m a discharge 5) rd 4 3 2 1 5 6789 reset is not entered. internal reset signal internally pulled low 3) 5 tcl
st10f269 111/160 unlike hardware and software resets, the watchdog reset completes a running external bus cycle if this bus cycle either does not use ready , or if ready is sampled active (low) after the programmed wait states. when ready is sampled inactive (high) after the programmed wait states the running external bus cycle is aborted. then the internal reset sequence (1024 tcl) is started. the microcontroller behaviour is the same as for a short hardware reset, except that only p0.12...p0.6 bits are latched, while previously latched values of p0.5...p0.2 are cleared. 18.5 - rstout , rstin , bidirectional reset 18.5.1 - rstout pin the rstout pin is driven active (low level) at the beginning of any reset sequence (synchronous/ asynchronous hardware, software and watchdog timer resets). rstout pin stays active low beyond the end of the initialization routine, until the protected einit instruction (end of initialization) is completed. 18.5.2 - bidirectional reset the bidirectional reset function is enabled by setting syscon.bdrsten (bit 3). this function is disabled by any reset sequence which always clears the syscon.bdrsten bit. it can only be enabled during the initialisation routine, before einit instruction is completed. if v rpd voltage drops below the rpd pin threshold (typically 2.5v for v dd = 5v) when rstin pin is low or when rstin pin is internally pulled low, the st10 reset circuitry disables the bidirectional reset function and rstin pin is no more pulled low. the reset is processed as an asynchronous reset. the bidirectional reset function is useful for external peripherals with on-chip memory because the reset signal output on rstin pin is de-activated before the cpu starts its first instruction fetch. 18.5.3 - rstin pin when the bidirectional reset function is enabled, the open-drain of the rstin pin is activated, pulling down the reset signal, for the duration of the internal reset sequence. see figure 56 and figure 57. at the end of the sequence the pull-down is released and the rstin pin gets back its input function. the bidirectional reset function can be used: C to convert sw or wd resets to a hardware reset so that the configuration can be (re-)latched from port0. C to make visible sw or wdt resets at rstin pin whenever rstin is the only reset signal used by the application (rstout not used). C to get a de-activated reset signal before cpu starts its first instruction fetch. the configuration latched from port0 is determined by the kind of reset generated by the application. (refer to table 29). converting a sw or wdt reset to a hardware reset allows the pll to re-lock or the pll configuration to be re-latched, provided a sw or wdt reset is generated by the application program is case of pll unlock or input clock fail. 18.6 - reset circuitry the internal reset circuitry is described in figure 58. an internal pull-up resistor is implemented on rstin pin. (50k w minimum, to 250k w maximum). the minimum reset time must be calculated using the lowest value. in addition, a programmable pull-down (syscon.bdrsten bit 3) drives the rstin pin according to the internal reset state. the rstout pin provides a signals to the application. (refer to section 18.5 - rstout, rstin, bidirectional reset). a weak internal pull-down is connected to the rpd pin to discharge external capacitor to v ss at a rate of 100 m a to 200 m a. this pull-down is turned on when rstin pin is low if bit pwdcfg of syscon register is set, an internal pull-up resistor is activated at the end of the reset sequence. this pull-up charges the capacitor connected to rpd pin. if the bidirectional reset function is not used, the simplest way to reset st10f269 is to connect external components as shown in figure 59. it works with reset from application (hardware or manual) and with power-on. the value of c1 capacitor, connected on rstin pin with internal pull-up resistor (50k w to
st10f269 112/160 250k w ), must lead to a charging time long enought to let the internal or external oscillator and / or the on-chip pll to stabilize. the r0-c0 components on rpd pin are mainly implemented to provide a time delay to exit power down mode (see chapter 19 - power reduction modes). nervertheless, they drive rpd pin level during resets and they lead to different reset modes as explained hereafter. on power-on, c0 is totaly discharged, a low level on rpd pin forces an asynchronous hardware reset. c0 capacitor starts to charge throught r0 and at the end of reset sequence st10f269 restarts. rpd pin threshold is typically 2.5v. depending on the delay of the next applied reset, the mcu can enter a synchronous reset or an asynchronous reset. if rpd pin is below 2.5v an asynchronous reset starts, if rpd pin is above 2.5v a synchronous reset starts. (see section 18.1 - long hardware reset and section 18.2 - short hardware reset). note that an internal pull-down is connected to rpd pin and can drive a 100 m a to 200 m a current. this pull-down is turned on when rstin pin is low. to properly use the bidirectional reset features, the schematic (or equivalent) of figure 60 must be implemented. r1-c1 only work for power-on or manual reset in the same way as explained previously. d1 diode brings a faster discharge of c1 capacitor at power-off during repetitive switch-on / switch-off sequences. d2 diode performs an or-wired connection, it can be replaced with an open drain buffer. r2 resistor may be added to increase the pull-up current to the open drain in order to get a faster rise time on rstin pin when bidirectional function is activated. the start-up configurations and some system features are selected on reset sequences as described in table 29 and table 30. table 29 describes what is the system configuration latched on port0 in the five different reset ways. table 30 summarizes the state of bits of port0 latched in rp0h, syscon, buscon0 registers. figure 58 : internal (simplified) reset circuitry. rstout einit instruction trigger clr clock reset state machine internal reset signal reset sequence (512 cpu clock cycles) srst instruction watchdog overflow rstin v dd bdrsten v dd rpd weak pull-down (~200 m a) from/to exit powerdown circuit asynchronous reset clr q set
st10f269 113/160 figure 59 : minimum external reset circuitry figure 60 : external reset hardware circuitry table 29 : port0 latched configuration for the different resets notes: 1. not latched from port0. 2. only rp0h low byte is used and the bit-fields are latched from port0 high byte to rp0h low byte. 3. indirectly depend on port0. 4. bits set if ea pin is 1. x : pin is sampled - : pin is not sampled port0 clock options segm. addr. lines chip selects wr config. bus type reserved bsl reserved reserved adapt mode emu mode sample event p0h.7 p0h.6 p0h.5 p0h.4 p0h.3 p0h.2 p0h.1 p0h.0 p0l.7 p0l.6 p0l.5 p0l.4 p0l.3 p0l.2 p0l.1 p0l.0 software reset - - - x x x x x x x - - - - - - watchdog reset - - - x x x x x x x - - - - - - short hardware reset - - - x x x x x x x x x x x x x long hardware reset xxxxxxxxxxxxxxxx power-on reset x x x x x x x x x x x x x x x x table 30 : port0 bits latched into the different registers after reset port0 bit nber h7 h6 h5 h4 h3 h2 h1 h0 i7 i6 i5 i4 i3 i2 i1 i0 port0 bit name clkcfg clkcfg clkcfg salsel salsel cssel cssel wrc bustyp bustyp r bsl r r adp emu rp0h 2 x 1 x 1 x 1 x 1 x 1 x 1 x 1 x 1 clkcfg clkcfg clkcfg salsel salsel cssel cssel wrc syscon x 1 x 1 x 1 x 1 x 1 x 1 bytdis 3 x 1 wrcfg 3 x 1 x 1 x 1 x 1 x 1 x 1 x 1 buscon0 x 1 x 1 x 1 x 1 -bus act0 4 ale ctl0 4 -btypbtypx 1 x 1 x 1 x 1 x 1 x 1 internal logic to clock generator to port 4 logic to port 6 logic x 1 x 1 x 1 x 1 internal x 1 x 1 internal internal + + rstout rstin rpd c0 r0 v dd c1 external hardware st10f269 a) manual hardware reset1 b) for automatic power-up and a) b) interruptible power-down mode d2 rstout rstin rpd open - drain d1 + c0 r0 v dd st10f269 v dd external hardware inverter + c1 r1 v dd reset source external r2
st10f269 114/160 19 - power reduction modes two different power reduction modes with different levels of power reduction have been implemented in the st10f269. in idle mode only cpu is stopped, while peripheral still operate. in power down mode both cpu and peripherals are stopped. both mode are software activated by a protected instruction and are terminated in different ways as described in the following sections. note: all external bus actions are completed before idle or power down mode is entered. however, idle or power down mode is not entered if ready is enabled, but has not been activated (driven low for negative polarity, or driven high for positive polarity) during the last bus access. 19.1 - idle mode idle mode is entered by running idle protected instruction. the cpu operation is stopped and the peripherals still run. idle mode is terminate by any interrupt request. whatever the interrupt is serviced or not, the instruction following the idle instruction will be executed after return from interrupt (reti) instruction, then the cpu resumes the normal program. note that a pec transfer keep the cpu in idle mode. if the pec transfer does not succeed, the idle mode is terminated. watchdog timer must be properly programmed to avoid any disturbance during idle mode. 19.2 - power down mode power down mode starts by running pwrdn protected instruction. internal clock is stopped, all mcu parts are on hold including the watchdog timer. there are two different operating power down modes : protected mode and interruptible mode. the internal ram contents can be preserved through the voltage supplied via the v dd pins. to verify ram integrity, some dedicated patterns may be written before entering the power down mode and have to be checked after power down is resumed. it is mandatory to keep v dd = +5v 10% during power-down mode, because the on-chip voltage regulator is turned in power saving mode and it delivers 2.5v to the core logic, but it must be supplied at nominal v dd = +5v. 19.2.1 - protected power down mode this mode is selected when pwdcfg (bit 5) of syscon register is cleared. the protected power down mode is only activated if the nmi pin is pulled low when executing pwrdn instruction (this means that the pwrd instruction belongs to the nmi software routine). this mode is only desactivated with an external hardware reset on rstin pin. note: during power down the on-chip voltage regulator automatically lowers the internal logic supply voltage to 2.5v, to save power and to keep internal ram and registers contents. 19.2.2 - interruptable power down mode this mode is selected when pwdcfg (bit 5) of syscon register is set (see chapter 20 - special function register overview). the interruptable power down mode is only activated if all the enabled fast external interrupt pins are in their inactive level (see exicon register description below). this mode is desactivated with an external reset applied to rstin pin or with an interrupt request applied to one of the fast external interrupt pins. to allow the internal pll and clock to stabilize, the rstin pin must be held low according the recommandations described in chapter 18 - system reset.
st10f269 115/160 exicon ( f1c0h / e0h esfr reset value: 0000h exxin inputs are normally sampled interrupt inputs. however, the power down mode circuitry uses them as level-sensitive inputs. an exxin (x = 3...0) interrupt enable bit (bit ccxie in respective ccxic register) need not be set to bring the device out of power down mode. an external rc circuit must be connected to rpd pin, as shown in the figure 61. to exit power down mode with an external interrupt, an exxin (x = 7...0) pin has to be asserted for at least 40ns. this signal enables the internal oscillator and pll circuitry, and also turns on the weak pull-down (see figure 62). the discharge of the external capacitor provides a delay that allows the oscillator and pll circuits to stabilize before the internal cpu and peripheral clocks are enabled. when the rpd voltage drops below the threshold voltage (about 2.5v), the schmitt trigger clears q2 flip-flop, thus enabling the cpu and peripheral clocks, and the device resumes code execution. if the interrupt was enabled (bit ccxie=1 in the respective ccxic register) before entering power down mode, the device executes the interrupt service routine, and then resumes execution after the pwrdn intruction (see note below). if the interrupt was disabled, the device executes the instruction following pwrdn instruction, and the interrupt request flag (bit ccxir in in the respective ccxic register) remains set until it is cleared by software. note: due to the internal pipeline, the instruction that follows the pwrdn intruction is executed before the cpu performs a call of the interrupt service routine when exiting power-down mode 1514131211109876543210 exi7es exi6es exi5es exi4es exi3es exi2es exi1es exi0es rw rw rw rw rw rw rw rw exixes(x=7...0) external interrupt x edge selection field (x=7...0) 0 0: fast external interrupts disabled: standard mode exxin pin not taken in account for entering/exiting power down mode. 0 1: interrupt on positive edge (rising) enter power down mode if exiin = 0, exit if exxin = 1 (referred as high active level) 1 0: interrupt on negative edge (falling) enter power down mode if exiin = 1, exit if exxin = 0 (referred as low active level) 1 1: interrupt on any edge (rising or falling) always enter power down mode, exit if exxin level changed. figure 61 : external r0c0 circuit on rpd pin for exiting powerdown mode with external interrupt rpd v dd c0 r0 220k w minimum 1 m f typical st10f269-q3 +
st10f269 116/160 figure 62 : simplified powerdown exit circuitry figure 63 : powerdown exit sequence when using an external interrupt (pll x 2) dq q v dd enter cd external interrupt reset stop pll stop oscillator v dd dq q cd system clock cpu and peripherals clocks rpd v dd pull-up weak pull-down (~ 200 m a) powerdown q1 q2 cpu clk internal external rpd exitpwrd xtal1 interrupt (internal) ~ 2.5 v delay for oscillator/pll stabilization signal powerdown
st10f269 117/160 20 - special function register overview the following table lists all sfrs which are implemented in the st10f269 in alphabetical order. bit-addressable sfrs are marked with the letter b in column name. sfrs within the extended sfr-space (esfrs) are marked with the letter e in column physical address. a sfr can be specified by its individual mnemonic name. depending on the selected addressing mode, a sfr can be accessed via its physical address (using the data page pointers), or via its short 8-bit address (without using the data page pointers). the reset value is defined as following: x : means the full nibble is not defined at reset. x : means some bits of the nibble are not defined at reset. table 31 : special function registers listed by name name physical address 8-bit address description reset value adcic b ff98h cch a/d converter end of conversion interrupt control register - - 00h adcon b ffa0h d0h a/d converter control register 0000h addat fea0h 50h a/d converter result register 0000h addat2 f0a0h e 50h a/d converter 2 result register 0000h addrsel1 fe18h 0ch address select register 1 0000h addrsel2 fe1ah 0dh address select register 2 0000h addrsel3 fe1ch 0eh address select register 3 0000h addrsel4 fe1eh 0fh address select register 4 0000h adeic b ff9ah cdh a/d converter overrun error interrupt control register - - 00h buscon0 b ff0ch 86h bus configuration register 0 0xx0h buscon1 b ff14h 8ah bus configuration register 1 0000h buscon2 b ff16h 8bh bus configuration register 2 0000h buscon3 b ff18h 8ch bus configuration register 3 0000h buscon4 b ff1ah 8dh bus configuration register 4 0000h caprel fe4ah 25h gpt2 capture/reload register 0000h cc0 fe80h 40h capcom register 0 0000h cc0ic b ff78h bch capcom register 0 interrupt control register - - 00h cc1 fe82h 41h capcom register 1 0000h cc1ic b ff7ah bdh capcom register 1 interrupt control register - - 00h cc2 fe84h 42h capcom register 2 0000h cc2ic b ff7ch beh capcom register 2 interrupt control register - - 00h cc3 fe86h 43h capcom register 3 0000h cc3ic b ff7eh bfh capcom register 3 interrupt control register - - 00h cc4 fe88h 44h capcom register 4 0000h cc4ic b ff80h c0h capcom register 4 interrupt control register - - 00h cc5 fe8ah 45h capcom register 5 0000h cc5ic b ff82h c1h capcom register 5 interrupt control register - - 00h cc6 fe8ch 46h capcom register 6 0000h cc6ic b ff84h c2h capcom register 6 interrupt control register - - 00h cc7 fe8eh 47h capcom register 7 0000h cc7ic b ff86h c3h capcom register 7 interrupt control register - - 00h cc8 fe90h 48h capcom register 8 0000h cc8ic b ff88h c4h capcom register 8 interrupt control register - - 00h
st10f269 118/160 cc9 fe92h 49h capcom register 9 0000h cc9ic b ff8ah c5h capcom register 9 interrupt control register - - 00h cc10 fe94h 4ah capcom register 10 0000h cc10ic b ff8ch c6h capcom register 10 interrupt control register - - 00h cc11 fe96h 4bh capcom register 11 0000h cc11ic b ff8eh c7h capcom register 11 interrupt control register - - 00h cc12 fe98h 4ch capcom register 12 0000h cc12ic b ff90h c8h capcom register 12 interrupt control register - - 00h cc13 fe9ah 4dh capcom register 13 0000h cc13ic b ff92h c9h capcom register 13 interrupt control register - - 00h cc14 fe9ch 4eh capcom register 14 0000h cc14ic b ff94h cah capcom register 14 interrupt control register - - 00h cc15 fe9eh 4fh capcom register 15 0000h cc15ic b ff96h cbh capcom register 15 interrupt control register - - 00h cc16 fe60h 30h capcom register 16 0000h cc16ic b f160h e b0h capcom register 16 interrupt control register - - 00h cc17 fe62h 31h capcom register 17 0000h cc17ic b f162h e b1h capcom register 17 interrupt control register - - 00h cc18 fe64h 32h capcom register 18 0000h cc18ic b f164h e b2h capcom register 18 interrupt control register - - 00h cc19 fe66h 33h capcom register 19 0000h cc19ic b f166h e b3h capcom register 19 interrupt control register - - 00h cc20 fe68h 34h capcom register 20 0000h cc20ic b f168h e b4h capcom register 20 interrupt control register - - 00h cc21 fe6ah 35h capcom register 21 0000h cc21ic b f16ah e b5h capcom register 21 interrupt control register - - 00h cc22 fe6ch 36h capcom register 22 0000h cc22ic b f16ch e b6h capcom register 22 interrupt control register - - 00h cc23 fe6eh 37h capcom register 23 0000h cc23ic b f16eh e b7h capcom register 23 interrupt control register - - 00h cc24 fe70h 38h capcom register 24 0000h cc24ic b f170h e b8h capcom register 24 interrupt control register - - 00h cc25 fe72h 39h capcom register 25 0000h cc25ic b f172h e b9h capcom register 25 interrupt control register - - 00h cc26 fe74h 3ah capcom register 26 0000h cc26ic b f174h e bah capcom register 26 interrupt control register - - 00h cc27 fe76h 3bh capcom register 27 0000h cc27ic b f176h e bbh capcom register 27 interrupt control register - - 00h cc28 fe78h 3ch capcom register 28 0000h cc28ic b f178h e bch capcom register 28 interrupt control register - - 00h cc29 fe7ah 3dh capcom register 29 0000h cc29ic b f184h e c2h capcom register 29 interrupt control register - - 00h table 31 : special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f269 119/160 cc30 fe7ch 3eh capcom register 30 0000h cc30ic b f18ch e c6h capcom register 30 interrupt control register - - 00h cc31 fe7eh 3fh capcom register 31 0000h cc31ic b f194h e cah capcom register 31 interrupt control register - - 00h ccm0 b ff52h a9h capcom mode control register 0 0000h ccm1 b ff54h aah capcom mode control register 1 0000h ccm2 b ff56h abh capcom mode control register 2 0000h ccm3 b ff58h ach capcom mode control register 3 0000h ccm4 b ff22h 91h capcom mode control register 4 0000h ccm5 b ff24h 92h capcom mode control register 5 0000h ccm6 b ff26h 93h capcom mode control register 6 0000h ccm7 b ff28h 94h capcom mode control register 7 0000h cp fe10h 08h cpu context pointer register fc00h cric b ff6ah b5h gpt2 caprel interrupt control register - - 00h csp fe08h 04h cpu code segment pointer register (read only) 0000h dp0l b f100h e 80h p0l direction control register - - 00h dp0h b f102h e 81h p0h direction control register - - 00h dp1l b f104h e 82h p1l direction control register - - 00h dp1h b f106h e 83h p1h direction control register - - 00h dp2 b ffc2h e1h port 2 direction control register 0000h dp3 b ffc6h e3h port 3 direction control register 0000h dp4 b ffcah e5h port 4 direction control register 00h dp6 b ffceh e7h port 6 direction control register 00h dp7 b ffd2h e9h port 7 direction control register 00h dp8 b ffd6h ebh port 8 direction control register 00h dpp0 fe00h 00h cpu data page pointer 0 register (10-bit) 0000h dpp1 fe02h 01h cpu data page pointer 1 register (10-bit) 0001h dpp2 fe04h 02h cpu data page pointer 2 register (10-bit) 0002h dpp3 fe06h 03h cpu data page pointer 3 register (10-bit) 0003h exicon b f1c0h e e0h external interrupt control register 0000h exisel b f1dah e edh external interrupt source selection register 0000h idchip f07ch e 3eh device identifier register (n is the device revision) 10dnh idmanuf f07eh e 3fh manufacturer identifier register 0401h idmem f07ah e 3dh on-chip memory identifier register 3040h idprog f078h e 3ch programming voltage identifier register 0040h idx0 b ff08h 84h mac unit address pointer 0 0000h idx1 b ff0ah 85h mac unit address pointer 1 0000h mah fe5eh 2fh mac unit accumulator - high word 0000h mal fe5ch 2eh mac unit accumulator - low word 0000h mcw b ffdch eeh mac unit control word 0000h mdc b ff0eh 87h cpu multiply divide control register 0000h mdh fe0ch 06h cpu multiply divide register C high word 0000h mdl fe0eh 07h cpu multiply divide register C low word 0000h table 31 : special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f269 120/160 mrw b ffdah edh mac unit repeat word 0000h msw b ffdeh efh mac unit status word 0200h odp2 b f1c2h e e1h port 2 open drain control register 0000h odp3 b f1c6h e e3h port 3 open drain control register 0000h odp4 b f1cah e e5h port 4 open drain control register - - 00h odp6 b f1ceh e e7h port 6 open drain control register - - 00h odp7 b f1d2h e e9h port 7 open drain control register - - 00h odp8 b f1d6h e ebh port 8 open drain control register - - 00h ones b ff1eh 8fh constant value 1s register (read only) ffffh p0l b ff00h 80h port0 low register (lower half of port0) - - 00h p0h b ff02h 81h port0 high register (upper half of port0) - - 00h p1l b ff04h 82h port1 low register (lower half of port1) - - 00h p1h b ff06h 83h port1 high register (upper half of port1) - - 00h p2 b ffc0h e0h port 2 register 0000h p3 b ffc4h e2h port 3 register 0000h p4 b ffc8h e4h port 4 register (8-bit) 00h p5 b ffa2h d1h port 5 register (read only) xxxxh p6 b ffcch e6h port 6 register (8-bit) - - 00h p7 b ffd0h e8h port 7 register (8-bit) - - 00h p8 b ffd4h eah port 8 register (8-bit) - - 00h p5didis b ffa4h d2h port 5 digital disable register 0000h pocon0l f080h e 40h port0 low outpout control register (8-bit) - - 00h pocon0h f082h e 41h port0 high output control register (8-bit) - - 00h pocon1l f084h e 42h port1 low output control register (8-bit) - - 00h pocon1h f086h e 43h port1 high output control register (8-bit) - - 00h pocon2 f088h e 44h port2 output control register 0000h pocon3 f08ah e 45h port3 output control register 0000h pocon4 f08ch e 46h port4 output control register (8-bit) - - 00h pocon6 f08eh e 47h port6 output control register (8-bit) - - 00h pocon7 f090h e 48h port7 output control register (8-bit) - - 00h pocon8 f092h e 49h port8 output control register (8-bit) - - 00h pocon20 f0aah e 55h ale, rd , wr output control register (8-bit) 0000h pecc0 fec0h 60h pec channel 0 control register 0000h pecc1 fec2h 61h pec channel 1 control register 0000h pecc2 fec4h 62h pec channel 2 control register 0000h pecc3 fec6h 63h pec channel 3 control register 0000h pecc4 fec8h 64h pec channel 4 control register 0000h pecc5 fecah 65h pec channel 5 control register 0000h pecc6 fecch 66h pec channel 6 control register 0000h pecc7 feceh 67h pec channel 7 control register 0000h picon b f1c4h e e2h port input threshold control register - - 00h table 31 : special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f269 121/160 pp0 f038h e 1ch pwm module period register 0 0000h pp1 f03ah e 1dh pwm module period register 1 0000h pp2 f03ch e 1eh pwm module period register 2 0000h pp3 f03eh e 1fh pwm module period register 3 0000h psw b ff10h 88h cpu program status word 0000h pt0 f030h e 18h pwm module up/down counter 0 0000h pt1 f032h e 19h pwm module up/down counter 1 0000h pt2 f034h e 1ah pwm module up/down counter 2 0000h pt3 f036h e 1bh pwm module up/down counter 3 0000h pw0 fe30h 18h pwm module pulse width register 0 0000h pw1 fe32h 19h pwm module pulse width register 1 0000h pw2 fe34h 1ah pwm module pulse width register 2 0000h pw3 fe36h 1bh pwm module pulse width register 3 0000h pwmcon0 b ff30h 98h pwm module control register 0 0000h pwmcon1 b ff32h 99h pwm module control register 1 0000h pwmic b f17eh e bfh pwm module interrupt control register - - 00h qr0 f004h e 02h mac unit offset register qr0 0000h qr1 f006h e 03h mac unit offset register qr1 0000h qx0 f000h e 00h mac unit offset register qx0 0000h qx1 f002h e 01h mac unit offset register qx1 0000h rp0h b f108h e 84h system start-up configuration register (read only) - - xxh s0bg feb4h 5ah serial channel 0 baud rate generator reload register 0000h s0con b ffb0h d8h serial channel 0 control register 0000h s0eic b ff70h b8h serial channel 0 error interrupt control register - - 00h s0rbuf feb2h 59h serial channel 0 receive buffer register (read only) - - xxh s0ric b ff6eh b7h serial channel 0 receive interrupt control register - - 00h s0tbic b f19ch e ceh serial channel 0 transmit buffer interrupt control register - - 00h s0tbuf feb0h 58h serial channel 0 transmit buffer register (write only) 0000h s0tic b ff6ch b6h serial channel 0 transmit interrupt control register - - 00h sp fe12h 09h cpu system stack pointer register fc00h sscbr f0b4h e 5ah ssc baud rate register 0000h ssccon b ffb2h d9h ssc control register 0000h ssceic b ff76h bbh ssc error interrupt control register - - 00h sscrb f0b2h e 59h ssc receive buffer (read only) xxxxh sscric b ff74h bah ssc receive interrupt control register - - 00h ssctb f0b0h e 58h ssc transmit buffer (write only) 0000h ssctic b ff72h b9h ssc transmit interrupt control register - - 00h stkov fe14h 0ah cpu stack overflow pointer register fa00h stkun fe16h 0bh cpu stack underflow pointer register fc00h syscon b ff12h 89h cpu system configuration register 0xx0h 1 table 31 : special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f269 122/160 notes: 1. the system configuration is selected during reset. 2. bit wdtr indicates a watchdog timer triggered reset. 3. the xpnic interrupt control registers control interrupt requests from integrated x-bus peripherals. some software controlled interrupt requests may be generated by setting the xpnir bits (of xpnic register) of the unused x-peripheral nodes. t0 fe50h 28h capcom timer 0 register 0000h t01con b ff50h a8h capcom timer 0 and timer 1 control register 0000h t0ic b ff9ch ceh capcom timer 0 interrupt control register - - 00h t0rel fe54h 2ah capcom timer 0 reload register 0000h t1 fe52h 29h capcom timer 1 register 0000h t1ic b ff9eh cfh capcom timer 1 interrupt control register - - 00h t1rel fe56h 2bh capcom timer 1 reload register 0000h t2 fe40h 20h gpt1 timer 2 register 0000h t2con b ff40h a0h gpt1 timer 2 control register 0000h t2ic b ff60h b0h gpt1 timer 2 interrupt control register - - 00h t3 fe42h 21h gpt1 timer 3 register 0000h t3con b ff42h a1h gpt1 timer 3 control register 0000h t3ic b ff62h b1h gpt1 timer 3 interrupt control register - - 00h t4 fe44h 22h gpt1 timer 4 register 0000h t4con b ff44h a2h gpt1 timer 4 control register 0000h t4ic b ff64h b2h gpt1 timer 4 interrupt control register - - 00h t5 fe46h 23h gpt2 timer 5 register 0000h t5con b ff46h a3h gpt2 timer 5 control register 0000h t5ic b ff66h b3h gpt2 timer 5 interrupt control register - - 00h t6 fe48h 24h gpt2 timer 6 register 0000h t6con b ff48h a4h gpt2 timer 6 control register 0000h t6ic b ff68h b4h gpt2 timer 6 interrupt control register - - 00h t7 f050h e 28h capcom timer 7 register 0000h t78con b ff20h 90h capcom timer 7 and 8 control register 0000h t7ic b f17ah e beh capcom timer 7 interrupt control register - - 00h t7rel f054h e 2ah capcom timer 7 reload register 0000h t8 f052h e 29h capcom timer 8 register 0000h t8ic b f17ch e bfh capcom timer 8 interrupt control register - - 00h t8rel f056h e 2bh capcom timer 8 reload register 0000h tfr b ffach d6h trap flag register 0000h wdt feaeh 57h watchdog timer register (read only) 0000h wdtcon b ffaeh d7h watchdog timer control register 00xxh 2 xp0ic b f186h e c3h can1 module interrupt control register - - 00h 3 xp1ic b f18eh e c7h can2 module interrupt control register - - 00h 3 xp2ic b f196h e cbh flash ready/busy interrupt control register - - 00h 3 xp3ic b f19eh e cfh pll unlock interrupt control register - - 00h 3 xpercon f024h e 12h xper configuration register - - 05h zeros b ff1ch 8eh constant value 0s register (read only) 0000h table 31 : special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f269 123/160 20.1 - identification registers the st10f269 has four identification registers, mapped in esfr space. these register contain: C a manufacturer identifier, C a chip identifier, with its revision, C a internal memory and size identifier and programming voltage description. idmanuf (f07eh / 3fh) 1 esfr reset value: 0401h idchip (f07ch / 3eh) 1 esfr reset value: 10dxh idmem (f07ah / 3dh) 1 esfr reset value: 3040h idprog (f078h / 3ch) 1 esfr reset value: 0040h note : 1. all identification words are read only registers. 1514131211109876543210 manuf 00001 r manuf manufacturer identifier - 020h: stmicroelectronics manufacturer (jtag worldwide normalisation). 1514131211109876543210 chipid revid rr revid device revision identifier chipid device identifier - 10dh: st10f269 identifier. 15 14131211109876543210 memtyp memsize rr memsize internal memory size is calculated using the following formula: size = 4 x [memsize] (in k byte) - 040h for st10f269 (256k byte) memtyp internal memory type - 3h for st10f269 (flash memory). 1514131211109876543210 progvpp progvdd rr progvdd programming v dd vo lt a g e v dd voltage when programming eprom or flash devices is calculated using the following formula: v dd = 20 x [progvdd] / 256 (volts) - 40h for st10f269 (5v). progvpp programming v pp voltag e (no need of external v pp ) - 00h
st10f269 124/160 20.2 - system configuration registers the st10f269 has registers used for different configuration of the overall system. these registers are described below. syscon (ff12h / 89h) sfr reset value: 0xx0h notes: 1. these bit are set directly or indirectly according to port0 and ea pin configuration during reset sequence. 2. register syscon cannot be changed after execution of the einit instruction. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 stksz roms1 sgtdis romen bytdis clken wrcfg cscfg pwd cfg owd dis bdr sten xpen visible xper- share rw rw rw rw 1 rw 1 rw rw 1 rw rw rw rw rw rw rw xper-share xbus peripheral share mode control 0: external accesses to xbus peripherals are disabled 1: xbus peripherals are accessible via the external bus during hold mode visible visible mode control 0: accesses to xbus peripherals are done internally 1: xbus peripheral accesses are made visible on the external pins xpen xbus peripheral enable bit 0: accesses to the on-chip x-peripherals and xram are disabled 1: the on-chip x-peripherals are enabled. bdrsten bidirectional reset enable 0: rstin pin is an input pin only. (sw reset or wdt reset have no effect on this pin) 1: rstin pin is a bidirectional pin. this pin is pulled low during 1024 tcl during reset sequence. owddis oscillator watchdog disable control 0: oscillator watchdog (owd) is enabled. if pll is bypassed, the owd monitors xtal1 activity. if there is no activity on xtal1 for at least 1 m s, the cpu clock is switched automatically to plls base frequency (from 2 to 10mhz). 1: owd is disabled. if the pll is bypassed, the cpu clock is always driven by xtal1 signal. the pll is turned off to reduce power supply current. pwdcfg power down mode configuration control 0: power down mode can only be entered during pwrdn instruction execution if nmi pin is low, otherwise the instruction has no effect. exit power down only with reset. 1: power down mode can only be entered during pwrdn instruction execution if all enabled fast external interrupt exxin pins are in their inactive level. exiting this mode can be done by asserting one enabled exxin pin or with external reset. cscfg chip select configuration control 0: latched chip select lines: csx change 1 tcl after rising edge of ale 1: unlatched chip select lines: csx change with rising edge of ale.
st10f269 125/160 buscon0 (ff0ch / 86h) sfr reset value: 0xx0h buscon1 (ff14h / 8ah) sfr reset value: 0000h buscon2 (ff16h / 8bh) sfr reset value: 0000h buscon3 (ff18h / 8ch) sfr reset value: 0000h wrcfg write configuration control (inverted copy of bit wrc of rp0h) 0: pins wr and bhe retain their normal function 1: pin wr acts as wrl , pin bhe acts as wrh . clken system clock output enable (clkout) 0: clkout disabled: pin may be used for general purpose i/o 1: clkout enabled: pin outputs the system clock signal. bytdis disable/enable control for pin bhe (set according to data bus width) 0: pin bhe enabled 1: pin bhe disabled, pin may be used for general purpose i/o. romen internal memory enable (set according to pin ea during reset) 0: internal memory disabled: accesses to the memory area use the external bus 1: internal memory enabled. sgtdis segmentation disable/enable control 0: segmentation enabled (csp is saved/restored during interrupt entry/exit) 1: segmentation disabled (only ip is saved/restored). roms1 internal memory mapping 0: internal memory area mapped to segment 0 (000000h...007fffh) 1: internal memory area mapped to segment 1 (010000h...017fffh). stksz system stack size selects the size of the system stack (in the internal ram) from 32 to 1024 words. 15 14 13 12 11 10 9 876 5 4 3210 cswen0 csren0 rdypol0 rdyen0 - bus act0 ale ctl0 - btyp mttc0 rwdc0 mctc rw rw rw rw rw 2 rw 2 rw 1 rw rw rw 15 14 13 12 11 10 9 876 5 4 3210 cswen1 csren1 rdypol1 rdyen1 - busact1 alectl1 - btyp mttc1 rwdc1 mctc rw rw rw rw rw rw rw rw rw rw 15 14 13 12 11 10 9 876 5 4 3210 cswen2 csren2 rdypol2 rdyen2 - busact2 alectl2 - btyp mttc2 rwdc2 mctc rw rw rw rw rw rw rw rw rw rw 15 14 13 12 11 10 9 876 5 4 3210 cswen3 csren3 rdypol3 rdyen3 - busact3 alectl3 - btyp mttc3 rwdc3 mctc rw rw rw rw rw rw rw rw rw rw
st10f269 126/160 buscon4 (ff1ah / 8dh) sfr reset value: 0000h notes: 1. btyp (bit 6 and 7) are set according to the configuration of the bit l6 and l7 of port0 latched at the end of the rese t sequence. 2. buscon0 is initialized with 0000h, if ea pin is high during reset. if ea pin is low during reset, bit busact0 and alectrl0 are set (1) and bit field btyp is loaded with the bus configuration selected via port0. 15 14 13 12 11 10 9 876 5 4 3210 cswen4 csren4 rdypol4 rdyen4 - busact4 alectl4 - btyp mttc4 rwdc4 mctc rw rw rw rw rw rw rw rw rw rw mctc memory cycle time control (number of memory cycle time wait states) 0 0 0 0: 15 wait states (nber = 15 - [mctc]) . . . 1 1 1 1: no wait state rwdcx read/write delay control for busconx 0: with read/write delay: activate command 1 tcl after falling edge of ale 1: no read/write delay: activate command with falling edge of ale mttcx memory tristate time control 0: 1 wait state 1: no wait state btyp external bus configuration 0 0: 8-bit demultiplexed bus 0 1: 8-bit multiplexed bus 1 0: 16-bit demultiplexed bus 1 1: 16-bit multiplexed bus note: for buscon0, btyp bit-field is defined via port0 during reset. alectlx ale lengthening control 0: normal ale signal 1: lengthened ale signal busactx bus active control 0: external bus disabled 1: external bus enabled (within the respective address window, see addrsel) rdyenx ready input enable 0: external bus cycle is controlled by bit field mctc only 1: external bus cycle is controlled by the ready input signal rdypolx ready active level control 0: active level on the ready pin is low, bus cycle terminates with a 0 on ready pin, 1: active level on the ready pin is high, bus cycle terminates with a 1 on ready pin. csrenx read chip select enable 0: the cs signal is independent of the read command (rd ) 1: the cs signal is generated for the duration of the read command cswenx write chip select enable 0: the cs signal is independent of the write command (wr ,wrl ,wrh ) 1: the cs signal is generated for the duration of the write command
st10f269 127/160 rp0h (f108h / 84h) esfr reset value: --xxh notes: 1. rp0h.7 to rp0h.5 bits are loaded only during a long hardware reset. as pull-up resistors are active on each port p0h p ins during reset, rp0h default value is "ffh". 2. these bits are set according to port 0 configuration during any reset sequence. 3. rp0h is a read only register. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 -------- clksel salsel cssel wrc r 1 - 2 r 2 r 2 r 2 wrc 2 write configuration control 0: pin wr acts as wrl , pin bhe acts as wrh 1: pins wr and bhe retain their normal function cssel 2 chip select line selection (number of active cs outputs) 0 0: 3 cs lines: cs 2...cs 0 0 1: 2 cs lines: cs 1...cs 0 1 0: no cs line at all 1 1: 5 cs lines: cs 4...cs 0 (default without pull-downs) salsel 2 segment address line selection (number of active segment address outputs) 0 0: 4-bit segment address: a19...a16 0 1: no segment address lines at all 1 0: 8-bit segment address: a23...a16 1 1: 2-bit segment address: a17...a16 (default without pull-downs) clksel 1 - 2 system clock selection 000: f cpu = 2.5 x f osc 001: f cpu = 0.5 x f osc 010: f cpu = 1.5 x f osc 011: f cpu = f osc 100: f cpu = 5 x f osc 101: f cpu = 2 x f osc 110: f cpu = 3 x f osc 111: f cpu = 4 x f osc
st10f269 128/160 exicon ( f1c0h / e0h esfr reset value: 0000h exisel (f1dah / edh) esfr reset value: 0000h xp3ic (f19eh / cfh) 1 esfr reset value: --00h note: 1. xp3ic register has the same bit field as xxic interrupt registers 1514131211109876543210 exi7es exi6es exi5es exi4es exi3es exi2es exi1es exi0es rw rw rw rw rw rw rw rw exixes(x=7...0) external interrupt x edge selection field (x=7...0) 0 0: fast external interrupts disabled: standard mode exxin pin not taken in account for entering/exiting power down mode. 0 1: interrupt on positive edge (rising) enter power down mode if exiin = 0, exit if exxin = 1 (referred as high active level) 1 0: interrupt on negative edge (falling) enter power down mode if exiin = 1, exit if exxin = 0 (referred as low active level) 1 1: interrupt on any edge (rising or falling) always enter power down mode, exit if exxin level changed. 1514131211109876543210 exi7ss exi6ss exi5ss exi4ss exi3ss exi2ss exi1ss exi0ss rw rw rw rw rw rw rw rw exixss external interrupt x source selection (x=7...0) 00: input from associated port 2 pin. 01: input from alternate source. 10: input from port 2 pin ored with alternate source. 11: input from port 2 pin anded with alternate source. exixss port 2 pin alternate source 0 p2.8 can1_rxd 1 p2.9 can2_rxd 2 p2.10 rtcsi 3 p2.11 rtcai 4...7 p2.12...15 not used (zero) 1514131211109876543210 - - - - - - - - xp3ir xp3ie xp3ilvl glvl rw rw rw rw
st10f269 129/160 xxic (yyyyh / zzh) sfr area reset value: --00h xpercon (f024h / 12h) esfr reset value: --05h 1514131211109876543210 -------- xxir xxie ilvl glvl rw rw rw rw bit function glvl group level defines the internal order for simultaneous requests of the same priority. 3: highest group priority 0: lowest group priority ilvl interrupt priority level defines the priority level for the arbitration of requests. fh: highest priority level 0h: lowest priority level xxie interrupt enable control bit (individually enables/disables a specific source) 0: interrupt request is disabled 1: interrupt request is enabled xxir interrupt request flag 0: no request pending 1: this source has raised an interrupt request 1514131211109876543210 - -------- -- rtcen xram2en xram1en can2en can1en rw rw rw rw rw can1en can1 enable bit 0: accesses to the on-chip can1 xperipheral and its functions are disabled. p4.5 and p4.6 pins can be used as general purpose i/os. address range 00ef00h-00efffh is only directed to external memory if can2en is also 0. 1: the on-chip can1 xperipheral is enabled and can be accessed. can2en can2 enable bit 0: accesses to the on-chip can2 xperipheral and its functions are disabled. p4.4 and p4.7 pins can be used as general purpose i/os. address range 00ee00h-00eeffh is only directed to external memory if can1en is also 0. 1: the on-chip can2 xperipheral is enabled and can be accessed. xram1en xram1 enable bit 0: accesses to external memory within space 00e000h to 00e7ffh. the 2k bytes of internal xram1 are disabled. 1: accesses to the internal 2k bytes of xram1. xram2en xram2 enable bit 0: accesses to the external memory within space 00c000h to 00dfffh. the 8k bytes of internal xram2 are disabled. 1: accesses to the internal 8k bytes of xram2. rtcen rtc enable bit 0: accesses to the on-chip real time clock are disabled, external access performed. address range 00ec00h-00ecffh is only directed to external memory if can1en and can2en are 0 also 1: the on-chip real time clock is enabled and can be accessed.
st10f269 130/160 when both can are disabled via xpercon setting, then any access in the address range 00ee00h - 00efffh will be directed to external memory interface, using the busconx register corresponding to address matching addrselx register. p4.4 and p4.7 can be used as general purpose i/o when can2 is not enabled, and p4.5 and p4.6 can be used as general purpose i/o when can1 is not enabled. the default xper selection after reset is identical to xbus configuration of st10c167: xcan1 is enabled, xcan2 is disabled, xram1 (2k byte compatible xram) is enabled, xram2 (new 8k byte xram) is disabled. register xpercon cannot be changed after the global enabling of xperipherals, i.e. after setting of bit xpen in syscon register. in emulation mode, all the xperipherals are enabled (xpercon bit are all set). when the real time clock is disabled (rtcen = 0), the clock oscillator is switch off if st10 enters in power-down mode. otherwise, when the real time clock is enabled, the bit rtcoff of the rtccon register allows to choose the power-down mode of the clock oscillator.
st10f269 131/160 21 - electrical characteristics 21.1 - absolute maximum ratings note: 1. stresses above those listed under absolute maximum ratings may cause permanent damage to the device. this is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational se ctions of this specification is not implied. exposure to absolute maximum rating conditions for extended periods may affect device rel iability. during overload conditions (v in > v dd or v in < v ss ) the voltage on pins with respect to ground (v ss ) must not exceed the values defined by the absolute maximum ratings. 21.2 - parameter interpretation the parameters listed in the following tables represent the characteristics of the st10f269 and its demands on the system. where the st10f269 logic provides signals with their respective timing characteristics, the symbol cc for controller characteristics, is included in the symbol column. where the external system must provide signals with their respective timing characteristics to the st10f269, the symbol sr for system requirement, is included in the symbol column. 21.3 - dc characteristics v dd = 5v 10%, v ss = 0v, f cpu = 40mhz, reset active, t a = -40 to + 125c symbol parameter value unit v dd voltage on v dd pins with respect to ground 1 -0.5, +6.5 v v io voltage on any pin with respect to ground 1 -0.5, (v dd +0.5) v v aref voltage on v aref pin with respect to ground 1 -0.3, (v dd +0.3) v i ov input current on any pin during overload condition 1 -10, +10 ma i tov absolute sum of all input currents during overload condition 1 |100| ma p tot power dissipation 1 1.5 w t a ambient temperature under bias -40, +125 c t stg storage temperature 1 -65, +150 c symbol parameter te st conditions min. max. unit v il sr input low voltage C -0.5 0.2 v dd -0.1 v v ils sr input low voltage (special threshold) C -0.5 2.0 v v ih sr input high voltage (all except rstin and xtal1) C 0.2 v dd + 0.9 v dd + 0.5 v v ih1 sr input high voltage rstin C 0.6 v dd v dd + 0.5 v v ih2 sr input high voltage xtal1 C 0.7 v dd v dd + 0.5 v v ihs sr input high voltage (special threshold) C 0.8 v dd -0.2 v dd + 0.5 v hys input hysteresis (special threshold) 3 C 250 C mv v ol cc output low voltage (port0, port1, port 4, ale, rd , wr , bhe , clkout, rstout ) 1 i ol = 2.4ma C0.45v v ol1 cc output low voltage (all other outputs) 1 i ol1 = 1.6ma C0.45v
st10f269 132/160 notes: 1. st10f269 pins are equipped with low-noise output drivers which significantly improve the devices emi performance. the se low-noise drivers deliver their maximum current only until the respective target output level is reached. after this, the outpu t current is reduced. this results in increased impedance of the driver, which attenuates electrical noise from the connected pcb tracks. the v oh cc output high voltage (port0, port1, port4, ale, rd , wr , bhe , clkout, rstout ) 1 i oh = -500 m a i oh = -2.4ma 0.9 v dd 2.4 C C v v oh1 cc output high voltage (all other outputs) 1/2 i oh = C 250 m a i oh = C 1.6ma 0.9 v dd 2.4 C C v v i oz1 cc input leakage current (port 5) 0v < v in < v dd C 200 na i oz2 cc input leakage current (all other) 0v < v in < v dd C1 m a i ov sr overload current 3/4 C5ma r rst cc rstin pull-up resistor 3 C 50 250 k w i rwh read / write inactive current 5/6 v out = 2.4v C-40 m a i rwl read / write active current 5/7 v out = v olmax -500 C m a i alel ale inactive current 5/6 v out = v olmax 40 C m a i aleh ale active current 5/7 v out = 2.4v C 500 m a i p6h port 6 inactive current 5/6 v out = 2.4v C-40 m a i p6l port 6 active current 5/7 v out = v ol1max -500 C m a i p0h port0 configuration current 5/6 v in = v ihmin C-10 m a i p0l 5/7 v in = v ilmax -100 C m a i il cc xtal1 input current 0v < v in < v dd C20 m a gm on-chip oscillator transconductance 3 5 - ma/v c io cc pin capacitance (digital inputs / outputs) 3/5 f = 1mhz, t a = 25c C10pf i cc power supply current 8 rstin = v ih1 f cpu in [mhz] C 20 + 2.5 x f cpu ma i id idle mode supply current 9 rstin = v ih1 f cpu in [mhz] C 20 + f cpu ma i pd power-down mode supply current 10 v dd = 5.5v t a = 25c t a = 125c C _ 15 11 190 11 m a m a i pd2 power-down mode supply current (real time clock enabled, oscillator enabled) 10 12 v dd = 5.5v t a = 55c f osc = 25mhz C 2 + f osc / 4 ma symbol parameter te st conditions min. max. unit
st10f269 133/160 current specified in column test conditions is delivered in any cases. 2. this specification is not valid for outputs which are switched to open drain mode. in this case the respective output will f loat and the voltage results from the external circuitry. 3. partially tested, guaranteed by design characterization. 4. overload conditions occur if the standard operating conditions are exceeded, i.e. the voltage on any pin exceeds the specifi ed range (i.e. v ov > v dd +0.5v or v ov < -0.5v). the absolute sum of input overload currents on all port pins may not exceed 50ma. the supply voltage must remain within the specified limits. 5. this specification is only valid during reset, or during hold-mode or adapt-mode. port 6 pins are only affected if they are used for cs output and if their open drain function is not enabled. 6. the maximum current may be drawn while the respective signal line remains inactive. 7. the minimum current must be drawn in order to drive the respective signal line active. 8. the power supply current is a function of the operating frequency. this dependency is illustrated in the figure 64. these parameters are tested at v dd max and 40mhz cpu clock with all outputs disconnected and all inputs at vil or vih. the chip is configured with a demultiplexed 16-bit bus, direct clock drive, 5 chip select lines and 2 segment address lines, ea pin is low during reset. after reset, port 0 is driven with the value 00cch that produces infinite execution of nop instruction with 15 wait-sta tes, r/ w delay, memory tristate wait state, normal ale. peripherals are not activated. 9. idle mode supply current is a function of the operating frequency. this dependency is illustrated in the figure 64. these parameters are tested at v dd max and 40mhz cpu clock with all outputs disconnected and all inputs at v il or v ih . 10. this parameter value includes leakage currents. with all inputs (including pins configured as inputs) at 0v to 0.1v or at v dd C 0.1v to v dd , v ref = 0v, all outputs (including pins configured as outputs) disconnected. 11. typical i pd value is 5 m a @ t a =25c. and 60 m a @ t a =125c. 12. partially tested, guaranted by design characterization using 22pf loading capacitors on crystal pins. figure 64 : supply / idle current as a function of operating frequency i [ma] f cpu [mhz] 10 20 100 10 i cctyp i idmax i ccmax i idtyp 40 30 60ma 120ma 0
st10f269 134/160 21.3.1 - a/d converter characteristics v dd = 5v 10%, v ss = 0v , t a = -40 to +125c, 4.0v v aref v dd + 0.1v; v ss 0.1v v agnd v ss + 0.2v notes: 1. v ain may exceed v agnd or v aref up to the absolute maximum ratings. however, the conversion result in these cases will be x000h or x3ffh, respectively. 2. during the t s sample time the input capacitance c ain can be charged/discharged by the external source. the internal resistance of the analog source must allow the capacitance to reach its final voltage level within the t s sample time. after the end of the t s sample time, changes of the analog input voltage have no effect on the conversion result. values for the t sc sample clock depend on the programming. referring to the t c conversion time formula of section 21.3.2 - on page 135 and to table 33 on page 135: - t s min = 2 t sc min = 2 t cc min = 2 x 24 x tcl = 48 tcl - t s max = 2 t sc max = 2 x 8 t cc max = 2 x 8 x 96 tcl = 1536 tcl tcl is defined in section 21.4.2 -, section 21.4.4 -, and section 21.4.5 - on page 138 : 3. the conversion time formula is: - t c = 14 t cc + t s + 4 tcl (= 14 t cc + 2 t sc + 4 tcl) the t c parameter includes the t s sample time, the time for determining the digital result and the time to load the result register with the result of the conversion. values for the t cc conversion clock depend on the programming. referring to table 33 on page 135: - t c min = 14 t cc min + t s min + 4 tcl = 14 x 24 x tcl + 48 tcl + 4 tcl = 388 tcl - t c max = 14 t cc max + t s max + 4 tcl = 14 x 96 tcl + 1536 tcl + 4 tcl = 2884 tcl 4. this parameter is fixed by adc control logic. 5. dnl, inl, tue are tested at v aref =5.0v, v agnd =0v, v cc = 4.9v. it is guaranteed by design characterization for all other voltages within the defined voltage range. lsb has a value of v aref / 1024. the specified tue is guaranteed only if an overload condition (see i ov specification) occurs on maximum 2 not selected analog input pins and the absolute sum of input overload currents on all analog input pins does not exceed 10ma. 6. the coupling factor is measured on a channel while an overload condition occurs on the adjacent not selected channel with an absolute overload current less than 10ma. 7. partially tested, guaranteed by design characterization. 8.to remove noise and undesirable high frequency components from the analog input signal, a low-pass filter must be connected a t the adc input. the cut-off frequency of this filter should avoid 2 opposite transitions during the t s sampling time of the st10 adc: - f cut-off 1 / 5 t s to 1/10 t s where t s is the sampling time of the st10 adc and is not related to the nyquist frequency determined by the t c conversion time. table 32 : a/d converter characteristics symbol parameter test condition limit values unit minimum maximum v aref sr analog reference voltage 4.0 v dd + 0.1 v v ain sr analog input voltage 1 - 8 v agnd v aref v i aref cc reference supply current running mode power-down mode 7 C C 500 1 m a m a c ain cc adc input capacitance not sampling sampling 7 C C 10 15 pf pf t s cc sample time 2 - 4 48 tcl 1 536 tcl t c cc conversion time 3 - 4 388 tcl 2 884 tcl dnl cc differential nonlinearity 5 -0.5 +0.5 lsb inl cc integral nonlinearity 5 -1.5 +1.5 lsb ofs cc offset error 5 -1.0 +1.0 lsb tue cc total unadjusted error 5 -2.0 +2.0 lsb r asrc sr internal resistance of analog source t s in [ns] 2 - 7 C(t s / 150) - 0.25 k w k cc coupling factor between inputs 6 - 7 C1/500
st10f269 135/160 21.3.2 - conversion timing control when a conversion is started, first the capacitances of the converter are loaded via the respective analog input pin to the current analog input voltage. the time to load the capacitances is referred to as the sample time t s . next the sampled voltage is converted to a digital value in 10 successive steps, which correspond to the 10-bit resolution of the adc. the next 4 steps are used for equalizing internal levels (and are kept for exact timing matching with the 10-bit a/d converter module implemented in the st10f168). the current that has to be drawn from the sources for sampling and changing charges depends on the time that each respective step takes, because the capacitors must reach their final voltage level within the given time, at least with a certain approximation. the maximum current, however, that a source can deliver, depends on its internal resistance. the sample time t s (= 2 t sc ) and the conversion time t c (= 14 t cc + 2 t sc + 4 tcl) can be programmed relatively to the st10f269 cpu clock. this allows adjusting the a/d converter of the st10f269 to the properties of the system: fast conversion can be achieved by programming the respective times to their absolute possible minimum. this is preferable for scanning high frequency signals. the internal resistance of analog source and analog supply must be sufficiently low, however. high internal resistance can be achieved by programming the respective times to a higher value, or the possible maximum. this is preferable when using analog sources and supply with a high internal resistance in order to keep the current as low as possible. however the conversion rate in this case may be considerably lower. the conversion times are programmed via the upper four bit of register adcon. bit field adctc (conversion time control) selects the basic conversion clock t cc , used for the 14 steps of converting. the sample time t s is a multiple of this conversion time and is selected by bit field adstc (sample time control). the table below lists the possible combinations. the timings refer to the unit tcl, where f cpu = 1/2tcl. a complete conversion will take 14 t cc + 2 t sc + 4 tcl (fastest convertion rate = 4.85 m s at 40mhz). this time includes the conversion itself, the sample time and the time required to transfer the digital value to the result register. table 33 : adc sampling and conversion timing adctc conversion clock t cc adstc sample clock t sc tcl = 1/2 x f xtal at f cpu = 40mhz t sc = at f cpu = 40mhz and adctc = 00 00 tcl x 24 0.3 m s00 t cc 0.3 m s 01 reserved, do not use reserved 01 t cc x 2 0.6 m s 10 tcl x 96 1.2 m s10t cc x 4 1.2 m s 11 tcl x 48 0.6 m s11t cc x 8 2.4 m s
st10f269 136/160 21.4 - ac characteristics 21.4.1 - test waveforms 21.4.2 - definition of internal timing the internal operation of the st10f269 is controlled by the internal cpu clock f cpu . both edges of the cpu clock can trigger internal (for example pipeline) or external (for example bus cycles) operations. the specification of the external timing (ac characteristics) therefore depends on the time between two consecutive edges of the cpu clock, called tcl. the cpu clock signal can be generated by different mechanisms. the duration of tcl and its variation (and also the derived external timing) depends on the mechanism used to generate f cpu . this influence must be regarded when calculating the timings for the st10f269. the example for pll operation shown in figure 67 refers to a pll factor of 4. figure 65 : input / output waveforms figure 66 : float waveforms 2.4v 0.45v test points 0.2v dd +0.9 0.2v dd +0.9 0.2v dd -0.1 0.2v dd -0.1 a c inputs during testing are driven at 2.4v for a logic 1 and 0.4v for a logic 0. t iming measurements are made at v ih min for a logic 1 and v il max for a logic 0. timin g reference points v load +0.1v v load -0.1v v oh -0.1v v ol +0.1v v load v ol v oh for timing purposes a port pin is no longer floating when v load changes of 100mv. it begins to float when a 100mv change from the loaded v oh /v ol level occurs (i oh /i ol = 20ma).
st10f269 137/160 the mechanism used to generate the cpu clock is selected during reset by the logic levels on pins p0.15-13 (p0h.7-5). 21.4.3 - clock generation modes the table 34 associates the combinations of these three bits with the respective clock generation mode. notes: 1. the external clock input range refers to a cpu clock range of 1...40mhz. 2. the maximum input frequency depends on the duty cycle of the external clock signal. 3. the maximum input frequency is 25mhz when using an external crystal with the internal oscillator; providing that internal se rial resistance of the crystal is less than 40 w . however, higher frequencies can be applied with an external clock source on pin xtal1, but in this case, the input clock signal must reach the defined levels v il and v ih2. . figure 67 : generation mechanisms for the cpu clock table 34 : cpu frequency generation p0h.7 p0h.6 p0h.5 cpu frequency f cpu = f xtal x f external clock input range 1 notes 111 f xtal x 4 2.5 to 10mhz default configuration 110 f xtal x 3 3.33 to 13.33mhz 101 f xtal x 2 5 to 20mhz 100 f xtal x 5 2 to 8mhz 011 f xtal x 1 1 to 40mhz direct drive 2 010 f xtal x 1.5 6.66 to 26.66mhz 001 f xtal x 0.5 2 to 80mhz cpu clock via prescaler 3 000 f xtal x 2.5 4 to 16mhz tcl tcl tcl tcl f cpu f xtal f cpu f xtal phase locked loop operation direct clock drive tcl tcl f cpu f xtal prescaler operation
st10f269 138/160 21.4.4 - prescaler operation when pins p0.15-13 (p0h.7-5) equal 001 during reset, the cpu clock is derived from the internal oscillator (input clock signal) by a 2:1 prescaler. the frequency of f cpu is half the frequency of f xtal and the high and low time of f cpu (i.e. the duration of an individual tcl) is defined by the period of the input clock f xtal . the timings listed in the ac characteristics that refer to tcl therefore can be calculated using the period of f xtal for any tcl. note that if the bit owddis in syscon register is cleared, the pll runs on its free-running frequency and delivers the clock signal for the oscillator watchdog. if bit owddis is set, then the pll is switched off. 21.4.5 - direct drive when pins p0.15-13 (p0h.7-5) equal 011 during reset the on-chip phase locked loop is disabled and the cpu clock is directly driven from the internal oscillator with the input clock signal. the frequency of f cpu directly follows the frequency of f xtal so the high and low time of f cpu (i.e. the duration of an individual tcl) is defined by the duty cycle of the input clock f xtal . therefore, the timings given in this chapter refer to the minimum tcl. this minimum value can be calculated by the following formula: for two consecutive tcls, the deviation caused by the duty cycle of f xtal is compensated, so the duration of 2tcl is always 1/f xtal . the minimum value tcl min has to be used only once for timings that require an odd number of tcls (1,3,...). timings that require an even number of tcls (2,4,...) may use the formula: note: the address float timings in multiplexed bus mode (t 11 and t 45 ) use the maximum duration of tcl (tcl max = 1/f xtal x dc max ) instead of tcl min . if the bit owddis in syscon register is cleared, the pll runs on its free-running frequency and delivers the clock signal for the oscillator watchdog. if bit owddis is set, then the pll is switched off. 21.4.6 - oscillator watchdog (owd) an on-chip watchdog oscillator is implemented in the st10f269. this feature is used for safety operation with external crystal oscillator (using direct drive mode with or without prescaler). this watchdog oscillator operates as following : the reset default configuration enables the watchdog oscillator. it can be disabled by setting the owddis (bit 4) of syscon register. when the owd is enabled, the pll runs at its free-running frequency, and it increments the watchdog counter. the pll free-running frequency is between 2 and 10mhz. on each transition of external clock, the watchdog counter is cleared. if an external clock failure occurs, then the watchdog counter overflows (after 16 pll clock cycles). the cpu clock signal will be switched to the pll free-running clock signal, and the oscillator watchdog interrupt request (xp3int) is flagged. the cpu clock will not switch back to the external clock even if a valid external clock exits on xtal1 pin. only a hardware reset can switch the cpu clock source back to direct clock input. when the owd is disabled, the cpu clock is always external oscillator clock and the pll is switched off to decrease consumption supply current. 21.4.7 - phase locked loop for all other combinations of pins p0.15-13 (p0h.7-5) during reset the on-chip phase locked loop is enabled and it provides the cpu clock (see table 34). the pll multiplies the input frequency by the factor f which is selected via the combination of pins p0.15-13 (f cpu = f xtal x f). with every fth transition of f xtal the pll circuit synchronizes the cpu clock to the input clock. this synchronization is done smoothly, so the cpu clock frequency does not change abruptly. due to this adaptation to the input clock the frequency of f cpu is constantly adjusted so it is locked to f xtal . the slight variation causes a jitter of f cpu which also effects the duration of individual tcls. the timings listed in the ac characteristics that refer to tcls therefore must be calculated using the minimum tcl that is possible under the respective circumstances. tcl min 1f xt al l x l dc min = dc duty cycle = 2tcl 1 f xtal =
st10f269 139/160 the real minimum value for tcl depends on the jitter of the pll. the pll tunes f cpu to keep it locked on f xtal . the relative deviation of tcl is the maximum when it is refered to one tcl period. it decreases according to the formula and to the figure 68 given below. for n periods of tcl the minimum value is computed using the corresponding deviation d n : where n = number of consecutive tcl periods and 1 n 40. so for a period of 3 tcl periods (n = 3): d 3 = 4 - 3/15 = 3.8% 3tcl min =3tcl nom x (1 - 3.8/100) =3tcl nom x 0.962 3tcl min = 36.075ns (at f cpu = 40mhz) this is especially important for bus cycles using wait states and e.g. for the operation of timers, serial interfaces, etc. for all slower operations and longer periods (e.g. pulse train generation or measurement, lower baud rates, etc.) the deviation caused by the pll jitter is negligible. 21.4.8 - external clock drive xtal1 v dd = 5v 10%, v ss = 0v, t a = -40 to +125 c notes: 1. theoretical minimum. the real minimum value depends on the duty cycle of the input clock signal. 25mhz is the maximum input frequency when using an external crystal oscillator. however, 40mhz can be applied with an external clock source. 2. the input clock signal must reach the defined levels v il and v ih2 . tcl min tcl nom 1 d n 100 ------------- C ? ? ? ?? = d n 4n15 ) % [] C ( = figure 68 : approximated maximum pll jitter parameter symbol f cpu = f xtal f cpu = f xtal / 2 f cpu = f xtal x f f = 1.5/2,/2.5/3/4/5 unit min max min max min max oscillator period t osc sr 25 1 C 12.5 C 40 x n 100 x n ns high time t 1 sr 10 2 C 5 2 C 10 2 Cns low time t 2 sr 10 2 C 5 2 C 10 2 Cns rise time t 3 sr C 3 2 C 3 2 C 3 2 ns fall time t 4 sr C 3 2 C 3 2 C 3 2 ns 32 16 8 4 2 1 2 3 4 max.jitter [%] n this approximated formula is valid for 1 n 40 and 10mhz f cpu 40mhz.
st10f269 140/160 figure 69 : external clock drive xtal1 21.4.9 - memory cycle variables the tables below use three variables which are derived from the busconx registers and represent the special characteristics of the programmed memory cycle. the following table describes, how these variables are to be computed. description symbol values ale extension t a tcl x [alectl] memory cycle time wait states t c 2tcl x (15 - [mctc]) memory tri-state time t f 2tcl x (1 - [mttc]) t 1 t 3 t 4 v il t 2 t osc v ih2
st10f269 141/160 21.4.10 - multiplexed bus v dd = 5v 10%, v ss = 0v, t a = -40 to +125c, c l = 50pf, ale cycle time = 6 tcl + 2t a + t c + t f (75ns at 40mhz cpu clock without wait states). table 35 : multiplexed bus characteristics symbol parameter max. cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max. t 5 cc ale high time 4 + t a C tcl - 8.5 + t a Cns t 6 cc address setup to ale 2 + t a C tcl - 10.5 + t a Cns t 7 cc address hold after ale 1 4 + t a C tcl - 8.5 + t a Cns t 8 cc ale falling edge to rd , wr (with rw-delay) 4 + t a C tcl - 8.5 + t a Cns t 9 cc ale falling edge to rd , wr (no rw-delay) -8.5 + t a C -8.5 + t a Cns t 10 cc address float after rd , wr (with rw-delay) 1 C6 C 6ns t 11 cc address float after rd , wr (no rw-delay) 1 C 18.5 C tcl + 6 ns t 12 cc rd , wr low time (with rw-delay) 15.5 + t c C 2 tcl -9.5 + t c Cns t 13 cc rd , wr low time (no rw-delay) 28 + t c C 3 tcl -9.5 + t c Cns t 14 sr rd to valid data in (with rw-delay) C6 + t c C 2 tcl - 19 + t c ns t 15 sr rd to valid data in (no rw-delay) C 18.5 + t c C 3 tcl - 19 + t c ns t 16 sr ale low to valid data in C 18.5 + t a + t c C 3 tcl - 19 + t a + t c ns t 17 sr address/unlatched cs to valid data in C 22 + 2t a + t c C 4 tcl - 28 + 2t a + t c ns t 18 sr data hold after rd rising edge 0C 0 Cns t 19 sr data float after rd 1 C 16.5 + t f C 2 tcl - 8.5 + t f ns t 22 cc data valid to wr 10 + t c C 2 tcl -15 + t c Cns t 23 cc data hold after wr 4 + t f C 2 tcl - 8.5 + t f Cns t 25 cc ale rising edge after rd , wr 15 + t f C 2 tcl -10 + t f Cns t 27 cc address/unlatched cs hold after rd , wr 10 + t f C 2 tcl -15 + t f Cns t 38 cc ale falling edge to latched cs -4 - t a 10 - t a -4 - t a 10 - t a ns t 39 sr latched cs low to valid data in C 18.5 + t c + 2t a C 3 tcl - 19 + t c + 2t a ns t 40 cc latched cs hold after rd , wr 27 + t f C 3 tcl - 10.5 + t f Cns
st10f269 142/160 note: 1. partially tested, guaranted by design characterization. t 42 cc ale fall. edge to rdcs , wrcs (with rw delay) 7 + t a C tcl - 5.5+ t a Cns t 43 cc ale fall. edge to rdcs , wrcs (no rw delay) -5.5 + t a C -5.5 + t a Cns t 44 cc address float after rdcs , wrcs (with rw delay) 1 C0 C 0ns t 45 cc address float after rdcs , wrcs (no rw delay) 1 C 12.5 C tcl ns t 46 sr rdcs to valid data in (with rw delay) C4 + t c C 2 tcl - 21 + t c ns t 47 sr rdcs to valid data in (no rw delay) C 16.5 + t c C 3 tcl - 21 + t c ns t 48 cc rdcs , wrcs low time (with rw delay) 15.5 + t c C 2 tcl - 9.5 + t c Cns t 49 cc rdcs , wrcs low time (no rw delay) 28 + t c C 3 tcl - 9.5 + t c Cns t 50 cc data valid to wrcs 10 + t c C 2 tcl - 15+ t c Cns t 51 sr data hold after rdcs 0C 0 Cns t 52 sr data float after rdcs 1 C 16.5 + t f C 2 tcl - 8.5+t f ns t 54 cc address hold after rdcs , wrcs 6 + t f C 2 tcl - 19 + t f Cns t 56 cc data hold after wrcs 6 + t f C 2 tcl - 19 + t f Cns table 35 : multiplexed bus characteristics symbol parameter max. cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max.
st10f269 143/160 figure 70 : external memory cycle : multiplexed bus, with / without read / write delay, normal ale data in data out address address t 38 t 10 read cycle write cycle t 5 t 16 t 39 t 40 t 25 t 27 t 18 t 14 t 22 t 23 t 12 t 8 t 8 t 6m t 19 address t 17 t 6 t 7 t 9 t 11 t 13 t 15 t 16 t 12 t 13 address t 9 t 17 t 6 t 27 clkout ale csx a23-a16 (a15-a8) address/data rd wr wrl bhe wrh bus (p0) address/data bus (p0)
st10f269 144/160 figure 71 : external memory cycle: multiplexed mus, with / without read / write delay, extended ale data out address data in address address t 5 t 16 t 6 t 7 t 39 t 40 t 14 t 8 t 18 t 23 t 6 t 27 t 38 t 10 t 19 t 25 t 17 t 9 t 11 t 15 t 12 t 13 t 8 t 10 t 9 t 11 t 12 t 13 t 22 t 27 t 17 t 6 read cycle write cycle clkout ale csx a23-a16 (a15-a8) rd wr wrl bhe wrh address/data bus (p0) address/data bus (p0)
st10f269 145/160 figure 72 : external memory cycle: multiplexed bus, with / without read / write delay, normal ale, read / write chip select read cycle write cycle clkout ale a23-a16 (a15-a8) bhe data in data out address address t 44 t 5 t 16 t 25 t 27 t 51 t 46 t 50 t 56 t 48 t 42 t 42 t 6 t 52 address t 17 t 6 t 7 t 43 t 45 t 49 t 47 t 16 t 48 t 49 address t 43 rdcsx wrcsx address/data bus (p0) address/data bus (p0)
st10f269 146/160 figure 73 : external memory cycle: multiplexed bus, with / without read / write delay, extended ale, read / write chip select data out address data in address address t 5 t 16 t 6 t 7 t 46 t 42 t 42 t 50 t 18 t 56 t 6 t 54 t 44 t 19 t 25 t 17 t 43 t 45 t 47 t 48 t 49 t 49 t 43 t 48 t 44 t 45 read cycle write cycle clkout ale a23-a16 (a15-a8) bhe rdcsx wrcsx address/data bus (p0) address/data bus (p0)
st10f269 147/160 21.4.11 - demultiplexed bus v dd = 5v 10%, v ss = 0v, t a = -40 to +125c, c l = 50pf, ale cycle time = 4 tcl + 2t a + t c + t f (50ns at 40mhz cpu clock without wait states). table 36 : demultiplexed bus characteristics symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit minimum maximum minimum maximum t 5 cc ale high time 4 + t a C tcl - 8.5 + t a Cns t 6 cc address setup to ale 2 + t a C tcl - 10.5 + t a Cns t 80 cc address/unlatched cs setup to rd , wr (with rw-delay) 16.5 + 2t a C 2 tcl - 8.5 + 2t a Cns t 81 cc address/unlatched cs setup to rd , wr (no rw-delay) 4 + 2t a C tcl - 8.5 + 2t a Cns t 12 cc rd , wr low time (with rw-delay) 15.5 + t c C 2 tcl - 9.5 + t c Cns t 13 cc rd , wr low time (no rw-delay) 28 + t c C 3 tcl - 9.5 + t c Cns t 14 sr rd to valid data in (with rw-delay) C6 + t c C 2 tcl - 19 + t c ns t 15 sr rd to valid data in (no rw-delay) C 18.5 + t c C 3 tcl - 19 + t c ns t 16 sr ale low to valid data in C 18.5 + t a + t c C 3 tcl - 19 + t a + t c ns t 17 sr address/unlatched cs to valid data in C 22 + 2t a + t c C 4 tcl - 28 + 2t a + t c ns t 18 sr data hold after rd rising edge 0C 0 Cns t 20 sr data float after rd rising edge (with rw-delay) 1 3 C 16.5 + t f C 2 tcl - 8.5 + t f + 2t a 1 ns t 21 sr data float after rd rising edge (no rw-delay) 1 3 C4 + t f C tcl - 8.5 + t f + 2t a 1 ns t 22 cc data valid to wr 10 + t c C 2 tcl - 15 + t c Cns t 24 cc data hold after wr 4 + t f C tcl - 8.5 + t f Cns t 26 cc ale rising edge after rd , wr -10 + t f C -10 + t f Cns t 28 cc address/unlatched cs hold after rd , wr 2 0 (no t f ) -5 + t f (t f > 0) C 0 (no t f ) -5 + t f (t f > 0) Cns t 28h cc address/unlatched cs hold after wrh -5 + t f C-5 + t f Cns t 38 cc ale falling edge to latched cs -4 - t a 6 - t a -4 - t a 6 - t a ns t 39 sr latched cs low to valid data in C 18.5 + t c + 2t a C 3 tcl - 19 + t c + 2t a ns
st10f269 148/160 notes: 1. rw-delay and t a refer to the next following bus cycle. 2. read data are latched with the same clock edge that triggers the address change and the rising rd edge. therefore address changes before the end of rd have no impact on read cycles. 3. partially tested, guaranteed by design characterization. t 41 cc latched cs hold after rd , wr 2 + t f C tcl - 10.5 + t f Cns t 82 cc address setup to rdcs , wrcs (with rw-delay) 14.5 + 2t a C 2 tcl - 10.5 + 2t a Cns t 83 cc address setup to rdcs , wrcs (no rw-delay) 2 + 2t a C tcl - 10.5 + 2t a Cns t 46 sr rdcs to valid data in (with rw-delay) C4 + t c C 2 tcl - 21 + t c ns t 47 sr rdcs to valid data in (no rw-delay) C 16.5 + t c C 3 tcl - 21 + t c ns t 48 cc rdcs , wrcs low time (with rw-delay) 15.5 + t c C 2 tcl - 9.5 + t c Cns t 49 cc rdcs , wrcs low time (no rw-delay) 28 + t c C 3 tcl - 9.5 + t c Cns t 50 cc data valid to wrcs 10 + t c C 2 tcl - 15 + t c Cns t 51 sr data hold after rdcs 0C 0 Cns t 53 sr data float after rdcs (with rw-delay) 3 C 16.5 + t f C 2 tcl - 8.5 + t f ns t 68 sr data float after rdcs (no rw-delay) 3 C4 + t f C tcl - 8.5 + t f ns t 55 cc address hold after rdcs , wrcs -8.5 + t f C -8.5 + t f Cns t 57 cc data hold after wrcs 2 + t f C tcl - 10.5 + t f Cns table 36 : demultiplexed bus characteristics symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit minimum maximum minimum maximum
st10f269 149/160 figure 74 : external memory cycle: demultiplexed bus, with / without read / write delay, normal ale note: 1. un-latched csx = t 41u = t 41 tcl =10.5 + t f . write cycle clkout ale a23-a16 a15-a0 (p1) bhe wr wrl wrh data in data out t 38 t 5 t 16 t 39 t 41 t 18 t 14 t 22 t 12 address t 17 t 13 t 15 t 12 t 13 t 21 t 20 t 81 t 80 t 26 t 24 t 17 t 6 t 41u t 6 t 80 t 81 t 28 (or t 28h ) csx read cycle data bus (p0) rd 1) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0
st10f269 150/160 figure 75 : external memory cycle: demultiplexed bus, with / without read / write delay, extended ale address t 5 t 16 t 39 t 41 t 14 t 24 t 6 t 38 t 20 t 26 t 17 t 15 t 12 t 13 t 12 t 13 t 22 data in t 18 t 21 t 6 t 17 t 28 t 28 data out t 80 t 81 t 80 t 81 read cycle write cycle clkout ale csx rd wr wrl wrh data bus (p0) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0 a23-a16 a15-a0 (p1) bhe
st10f269 151/160 figure 76 : external memory cycle: demultiplexed bus, with / without read / write delay, normal ale, read / write chip select read cycle write cycle clkout ale data in data out t 5 t 16 t 51 t 46 t 50 t 48 address t 17 t 49 t 47 t 48 t 49 t 68 t 53 t 83 t 82 t 26 t 57 t 55 t 6 t 82 t 83 rdcsx wrcsx data bus (p0) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0 a23-a16 a15-a0 (p1) bhe
st10f269 152/160 figure 77 : external memory cycle: demultiplexed bus, no read / write delay, extended ale, read / write chip select address t 5 t 16 t 46 t 57 t 6 t 53 t 26 t 17 t 47 t 48 t 49 t 48 t 49 t 50 data in t 51 t 68 t 55 data out t 82 t 83 t 82 t 83 read cycle write cycle clkout ale rdcsx wrcsx data bus (p0) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0 a23-a16 a15-a0 (p1) bhe
st10f269 153/160 21.4.12 - clkout and ready v dd = 5v 10%, v ss = 0v, t a = -40 to + 125c, c l = 50pf notes: 1. these timings are given for test purposes only, in order to assure recognition at a specific clock edge. 2. demultiplexed bus is the worst case. for multiplexed bus 2tcl are to be added to the maximum values. this adds even more tim e for deactivating ready. the 2t a and t c refer to the next following bus cycle, t f refers to the current bus cycle. table 37 : clkout and ready characteristics symbol parameter maximum cpu clock = 40 mhz variable cpu clock 1/2tcl = 1 to 40 mhz unit minimum maximum minimum maximum t 29 cc clkout cycle time 25 25 2tcl 2tcl ns t 30 cc clkout high time 4 C tcl C 8.5 C ns t 31 cc clkout low time 3 C tcl C 9.5 C ns t 32 cc clkout rise time C 4 C 4 ns t 33 cc clkout fall time C 4 C 4 ns t 34 cc clkout rising edge to ale falling edge -2 + t a 8 + t a -2 + t a 8 + t a ns t 35 sr synchronous ready setup time to clkout 12.5 C 12.5 C ns t 36 sr synchronous ready hold time after clkout 2C 2 Cns t 37 sr asynchronous ready low time 35 C 2tcl + 10 C ns t 58 sr asynchronous ready setup time 1) 12.5 C 12.5 C ns t 59 sr asynchronous ready hold time 1) 2C 2 Cns t 60 sr async. ready hold time after rd , wr high (demultiplexed bus) 2) 0 0 + 2t a + t c + t f 2) 0 tcl - 12.5 + 2t a + t c + t f 2) ns
st10f269 154/160 figure 78 : clkout and ready notes: 1. cycle as programmed, including mctc wait states (example shows 0 mctc ws). 2. the leading edge of the respective command depends on rw-delay. 3. ready sampled high at this sampling point generates a ready controlled wait state, ready sampled low at this sampling point terminates the currently running bus cycle. 4. ready may be deactivated in response to the trailing (rising) edge of the corresponding command (rd or wr ). 5. if the asynchronous ready signal does not fulfill the indicated setup and hold times with respect to clkout (e.g. because clkout is not enabled), it must fulfill t 37 in order to be safely synchronized. this is guaranteed, if ready is removed in response to the command (see note 4)). 6. multiplexed bus modes have a mux wait state added after a bus cycle, and an additional mttc wait state may be inserted here. for a multiplexed bus with mttc wait state this delay is 2 clkout cycles, for a demultiplexed bus without mttc wait state this delay is zero. 7. the next external bus cycle may start here. t 30 t 34 t 35 t 36 t 35 t 36 t 58 t 59 t 58 t 59 wait state ready mux / tri-state 6) t 32 t 33 t 29 running cycle 1) t 31 t 37 3) 3) 5) t 60 4) 6) 2) 7) 3) 3) clkout ale rd , wr synchronous asynchronous ready ready
st10f269 155/160 21.4.13 - external bus arbitration v dd = 5v 10%, v ss = 0v, t a = -40 to +125c, c l = 50pf note: 1. partially tested, guaranteed by design characterization. notes: 1. the st10f269 will complete the currently running bus cycle before granting bus access. 2. this is the first possibility for breq to become active. 3. the cs outputs will be resistive high (pull-up) after t 64 . symbol parameter maximum cpu clock = 40 mhz variable cpu clock 1/2tcl = 1 to 40 mhz unit minimum maximum minimum maximum t 61 sr hold input setup time to clkout 15 C 15 C ns t 62 cc clkout to hlda high or breq low delay C 12.5 C 12.5 ns t 63 cc clkout to hlda low or breq high delay C 12.5 C 12.5 ns t 64 cc csx release 1 C 15 C 15 ns t 65 cc csx drive -4 15 -4 15 ns t 66 cc other signals release 1 C 15 C 15 ns t 67 cc other signals drive -4 15 -4 15 ns figure 79 : external bus arbitration (releasing the bus) t 61 t 63 t 66 1) t 64 1) 2) t 62 3) clkout hold hlda breq others csx (p6.x)
st10f269 156/160 figure 80 : external bus arbitration (regaining the bus) notes: 1. this is the last chance for breq to trigger the indicated regain-sequence. even if breq is activated earlier, the regain-sequence is initiated by hold going high. please note that hold may also be disactivated without the st10f269 requesting the bus. 2. the next st10f269 driven bus cycle may start here. clkout hold hlda other signals t 62 csx (on p6.x) t 67 t 62 1) 2) t 65 t 61 breq t 63 t 62
st10f269 157/160 21.4.14 - high-speed synchronous serial interface (ssc) timing 21.4.14.1 master mode v cc = 5v 10%, v ss = 0v, cpu clock = 40mhz, t a = -40 to +125c, c l = 50pf note: 1. timing guaranteed by design. the formula for ssc clock cycle time is : t 300 = 4 tcl * ( + 1) where represents the content of the ssc baud rate register, taken as unsigned 16-bit integer. notes: 1. the phase and polarity of shift and latch edge of sclk is programmable. this figure uses the leading clock edge as shi ft edge (drawn in bold), with latch on trailing edge (sscph = 0b), idle clock line is low, leading clock edge is low-to-high transition (sscpo = 0b). 2. the bit timing is repeated for all bits to be transmitted or received. symbol parameter maximum baud rate = 10m baud ( = 0001h) variable baud rate (=0001h-ffffh) unit minimum maximum minimum maximum t 300 cc ssc clock cycle time 100 100 8 tcl 262144 tcl ns t 301 cc ssc clock high time 40 C t 300 /2 - 10 Cns t 302 cc ssc clock low time 40 C t 300 /2 - 10 Cns t 303 cc ssc clock rise time C 10 C 10 ns t 304 cc ssc clock fall time C 10 C 10 ns t 305 cc write data valid after shift edge C 15 C 15 ns t 306 cc write data hold after shift edge 1 -2 C -2 C ns t 307p sr read data setup time before latch edge, phase error detection on (sscpen = 1) 37.5 C 2tcl+12.5 C ns t 308p sr read data hold time after latch edge, phase error detection on (sscpen = 1) 50 C 4tcl C ns t 307 sr read data setup time before latch edge, phase error detection off (sscpen = 0) 25 C 2tcl C ns t 308 sr read data hold time after latch edge, phase error detection off (sscpen = 0) 0C0Cns figure 81 : ssc master timing t 303 t 304 t 305 t 305 t 305 t 306 1st out bit last out bit 2nd out bit t 300 t 302 t 301 1) 2) t 307 2nd.in bit 1st.in bit t 308 t 307 last.in bit t 308 sclk mtsr mrst
st10f269 158/160 21.4.14.2 slave mode v cc = 5v 10%, v ss = 0v, cpu clock = 40mhz, t a = -40 to +125c, c l = 50pf the formula for ssc clock cycle time is: t 310 = 4 tcl * ( + 1) where represents the content of the ssc baud rate register, taken as unsigned 16-bit integer. notes: 1. the phase and polarity of shift and latch edge of sclk is programmable. this figure uses the leading clock edge as shi ft edge (drawn in bold), with latch on trailing edge (sscph = 0b), idle clock line is low, leading clock edge is low-to-high transition (sscpo = 0b). 2. the bit timing is repeated for all bits to be transmitted or received. symbol parameter maximum baud rate=10mbd ( = 0001h) variable baud rate (=0001h-ffffh) unit minimum maximum minimum maximum t 310 sr ssc clock cycle time 100 100 8 tcl 262144 tcl ns t 311 sr ssc clock high time 40 C t 310 /2 - 10 Cns t 312 sr ssc clock low time 40 C t 310 /2 - 10 Cns t 313 sr ssc clock rise time C 10 C 10 ns t 314 sr ssc clock fall time C 10 C 10 ns t 315 cc write data valid after shift edge C 39 C 2 tcl + 14 ns t 316 cc write data hold after shift edge 0 C 0 C ns t 317p sr read data setup time before latch edge, phase error detection on (sscpen = 1) 62 C 4tcl + 12 C ns t 318p 1 sr read data hold time after latch edge, phase error detection on (sscpen = 1) 87 C 6tcl + 12 C ns t 317 sr read data setup time before latch edge, phase error detection off (sscpen = 0) 6C6Cns t 318 sr read data hold time after latch edge, phase error detection off (sscpen = 0) 31 C 2tcl + 6 C ns figure 82 : ssc slave timing t 313 t 314 t 315 t 315 t 315 t 316 1st out bit last out bit 2nd out bit t 310 t 312 t 311 1) 2) t 317 2nd.in bit 1st.in bit t 318 t 317 last.in bit t 318 sclk mrst mtsr
st10f269 159/160 22 - package mechanical data note: 1. package dimensions are in mm. the dimensions quoted in inches are rounded. 23 - ordering information figure 83 : package outline pqfp144 (28 x 28mm) dimensions millimeters 1 inches (approx) minimum typical maximum minimum typical maximum a 4.07 0.160 a1 0.25 0.010 a2 3.17 3.42 3.67 0.125 0.133 0.144 b 0.22 0.38 0.009 0.015 c 0.13 0.23 0.005 0.009 d 30.95 31.20 31.45 1.219 1.228 1.238 d1 27.90 28.00 28.10 1.098 1.102 1.106 d3 22.75 0.896 e 0.65 0.026 e 30.95 31.20 31.45 1.219 1.228 1.238 e1 27.90 28.00 28.10 1.098 1.102 1.106 l 0.65 0.80 0.95 0.026 0.031 0.037 l1 1.60 0.063 k 0 (minimum), 7 (maximum) salestype temperature range package st10f269-q3 -40c to +125c pqfp144 (28 x 28 mm) 144 109 d3 e 37 72 1 36 b a1 a2 a d1 d 73 108 e3 e1 e 0,10 mm .004 inch seating plane c l k l1
st10f269 160/160 f269-q3.ref information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result f rom its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specificati ons mentioned in this publication are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics products are not authorized for use as critical components in life support devices or systems without express written approval of stmicroelectronics. the st logo is a registered trademark of stmicroelectronics ? 2002 stmicroelectronics all rights reserved stmicroelectronics group of companies australia - brazil - canada - china - finland - france - germany - hong kong - india - israel - italy - japan - malaysia - malt a - morocco singapore - spain - sweden - switzerland - united kingdom - united states http://www.st.com


▲Up To Search▲   

 
Price & Availability of ST10F269-DP

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X